Variables
Here are the variables I have at the beginning of my .procmailrc. The
ones with the # are not enabled.
MAILDIR=$HOME/mail # your default mail folder (this is the default)
LOGFILE=$MAILDIR/proclog # a brief log - defining this turns logging on
#DEFAULT=$MAILDIR/other # where your mail goes if it matches nothing
#VERBOSE=ON # for debugging
-
grep the body of the message.
This one looks for the string "foofoofoo" in the body of the
message and sends it to /dev/null.
:0 B
* foofoofoo
/dev/null
-
grep in the headers of the message
This one looks for the string "cyberpromo.com" in the From: line and
sends it to /dev/null.
:0 H
* ^From:.*cyberpromo\.com
/dev/null
grep'ing the headers is the default, so you can do it with or without
the "H" in the first line.
-
Email forwarding.
Forward email to me@inch.com to me@aol.com
:0
* ^TOme@inch\.com
! me@aol.com
-
Simple autoresponder.
This looks for anything from johndoe and sends the contents
of the file received_your_message.txt back to the sender. It
also quotes the contents of their message, and places the original in
your inbox folder.
:0 c
* ^From.*johndoe
|(/usr/local/bin/formail -k -r ; \
cat $HOME/can/received_your_message.txt) | $SENDMAIL -t
:0 A
inbox
-
Using vacation with procmail
Click here.
-
For more info
Read the man pages on procmail,procmailex,procmailrc
"man procmail", "man procmailex", "man procmailrc".