procmail
[Top] [All Lists]

FW: Newbie, needs a hand please

2004-03-29 01:34:43
Hallo List,
I think I asked this question before, but I haven't received any response.
It seems my first mail was somehow formatted wrongly. My apologies for that.
If somebody has the time, could you give me your opinion on the below - it
would be much appreciated.


[Hopefully in plain text this time - my apologies for the previous mail]

Hallo list,

I am in the process of trying to learn very simple procmail scripts.
What I want is to send an autoreponder to all messages and then delete the
message.
The tricky part is I want some to get through, so in effect, all messages
except those having certain keywords in the From: field should get an auto
responder and then the mail gets deleted, the ones I let through should just
get delivered.
This is what I have so far, the keywords here are 'apple', 'pear' and
'potato'. If these are in the From: field they should be allowed through. I
want to match on the exact word, for example a match on apple but not on
appl .

PATH=/bin:/usr/bin:/usr/bin
MAILDIR=/var/spool/mail
LOGFILE=$MAILDIR/from
:0
* !^FROM_DAEMON
* !^From:.*(apple|pear|potato)
* !^X-Loop:account(_at_)server(_dot_)com
| (formail -r -I"Precedence: junk" \
 -A"X-Loop: account(_at_)server(_dot_)com" ; \
cat $HOME/.autoreply ) | $SENDMAIL -t

Can somebody tell me whether this is OK, what potential pitfalls I might get
etc..

Many thanks advance.

Stef


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>