-----BEGIN PGP SIGNED MESSAGE-----
On Mon, 15 Apr 1996, Seth Anderson wrote:
Date: Mon, 15 Apr 1996 21:05:01 -0500 (CDT)
From: Seth Anderson <sanderso(_at_)the-college(_dot_)iwctx(_dot_)edu>
To: procmail(_at_)informatik(_dot_)rwth-aachen(_dot_)de
Subject: HELP!!!!!
Okay, here's a question for you: I am trying to setup a weekly-posted
survey. Now, I am trying to setup a recipe file that will process all
messages that have the subject line: "+survey"... And *ONLY* that
text... If the subject does have "+survey" and more extraneous junk, an
error file is to be sent. ( A little "info" file)...
Then I don't want to call "sendmail", I want to call "pgpsendmail" which
will at least *TRY* to encrypt it before transmitting it. I thought a
recipe like this might work:
I guess pgpsendmail uses the same syntax as sendmail, you should try an
action line like:
| formail -r |pgpsendmail
formail -r generates a reply message and pgpsendmail will encrypt and
send it. Check the man pages to see if you need to set other flags (for
formail as well as pgpsendmail).
# Procmail 3.11pre4 Mail Filter Configuration File
# Last updated on April 14, 1996 by Seth Anderson
PATH=/bin:/usr/bin:/usr/local/bin
MAILDIR=$HOME/INBOX/
SENDMAIL=$PGPPATH/pgpsendmail
LOCKFILE=$HOME/.lockmail
You are already using local lockfiles, so delete this line.
LOGFILE=$HOME/procmail.log
DEFAULT=$HOME/INBOX/P2P_Public
SHELL=/bin/csh
VERBOSE=off
...
# Messages from the System Administrator
:0:
* ^From:.(*sysadm*|*root*)
Sysadm
Seems to me like you should catch up on your regular expressions. A `*'
means: `match the previous regular expression 0 or more times'. I think you
want:
* ^From:.*(sysadm|root).*
This will match any From: line containing sysadm or root.
(more comments later on)
# All requests for the surveys...
* (^Subject:) +file +request +survey
:0:
WHOFROM=`formail -xFrom:`
LOG=$WHOFROM # Log the requestor
:0 ah
| processf << $SURVEY/survey.auto-reply
1. Put the recipe header (":0:") first, and then the condition.
2. Remove the parentheses, you don't need them.
3. Specify a lockfile. Since you're piping to a command, procmail can't
choose a name itself.
4. `<<' specifies 'here-doc' inclusions. Look it up in your csh man
pages. You can't use that here. If you want processf to use
$SURVEY/survey.auto-reply as input file, you need a single `<'
# From Ben...
:0:
* (^From:)(_dot_)*blugg(_at_)the-college(_dot_)iwctx(_dot_)edu*
^^
This means "Match 0 or more u's at the end. You probably want "match the
specified address and then any number of characters". That would be `.*'
at the end. But you don't need that, as procmail already ignores
everything after your regexp.
[Similar recipes snipped, same comments apply]
# Dartmouth's Computer Science Technical Reports
:0:
* (^To|^From|^Cc:)(_dot_)*cs-tr(_at_)dartmouth(_dot_)edu*
CSTR
You could also write this as
* (^TO|^From.*)cs-tr(_at_)dartmouth(_dot_)edu
Look up the ^TO in the procmailrc(5) man page. (If your procmail is new
enough.)
[snipped, same comments still apply]
I'm fairly new to procmail, there might still be some errors I didn't
notice, but this will put you on the right track.
- --
Guy Geens <guy(_dot_)geens(_at_)elis(_dot_)rug(_dot_)ac(_dot_)be>: Ph.D.
student at ELIS -- TFCG / IMEC
Home Page: http://www.elis.rug.ac.be/ELISgroups/tfcg/staff/gg.html
finger ggeens(_at_)elis(_dot_)rug(_dot_)ac(_dot_)be for PGP public keys (or use
keyserver)
A friend with weed is a friend indeed.
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv
Comment: pgp fingerprints in message headers
iQBVAwUBMXNL5XwHoCha5QR1AQE8yQH7B5SwC1q0arC9mA7QOuN9rv2niUQjk5Ug
oT4L6X8YHIvERDDE5T79xqZAlUM02G/m0LtZwBkyMnF2u34tXtmwng==
=rbPa
-----END PGP SIGNATURE-----