Forum Moderators: phranque
##################################
###### SPECIFY SYSTEM VARIABLES
##################################
MAILDIR=$HOME/Maildir
PMDIR=$HOME/.Procmail # Directory for storing procmail-related files
SENDMAIL=/usr/sbin/sendmail
LOGFILE=$PMDIR/log # Optional, but recommended
VERBOSE=no # Set to yes when debugging
## LOGABSTRACT=all # Remove ## when debugging; set to no if you want minimal logging
##################################
###### MATCH CERTAIN MESSAGES
###################################
:0:
* ^From.*Mike Schuppe
*!^FROM_DAEMON
*!^FROM_MAILER
*!^X-Loop: myaddress@mydomain.com
#######################################
###### DO SOMETHING WITH THE MESSAGES
#######################################
¦ (formail -rk \
-A "X-Loop: myaddress@mydomain.com" \
echo "Please don't send me any more mail.";\
echo "(This is an automated response.)";)\
¦ $SENDMAIL -t -oi
#######################################
###### CATCH-ALL FOR INBOX
#######################################
:0
$HOME/Maildir/
[edited by: jdMorgan at 4:02 am (utc) on June 29, 2004]
[edit reason] Disabled smilies in code [/edit]
{
:0 h c
¦ (formail -t -r -A"X-Loop: address@mydomain.com " ; \
cat /path/to/junkresponse.txt ) ¦ $SENDMAIL -t
:0:
/dev/null
}
----------------
SENDMAIL=/usr/sbin/sendmail
LOGFILE=$HOME/.procmaillog # Optional, but recommended
#VERBOSE=yes # Set to yes when debugging
#LOGABSTRACT=all # all=full logging; no= minimal logging
:0:
* ^From.*John Doe
*!^FROM_DAEMON
*!^FROM_MAILER
*!^X-Loop: address@mydomain.com
¦ (formail -t -r -A"X-Loop: address@mydomain.com " ; \
cat "Your message was tagged as spam and deleted. If it wasn't spam, please visit my website and send your mail through the form there." )\
¦ $SENDMAIL -t
:0
$HOME/Maildir/
--------------------------
procmail: [26204] Thu Jul 1 12:19:05 2004
procmail: Assigning "LOGABSTRACT=all"
procmail: Match on "^From.*John Doe"
procmail: Match on! "(^(Mailing-List:¦Precedence:.*(junk¦bulk¦list)¦To: Multiple recipients of ¦(((Resent-)?(From¦Sender)¦X-Envelope-From):¦>?From )([^>]*[^(.%@a-z0-9])?(Post(ma?(st(e?r)?¦n)¦office)¦(send)?Mail(er)?¦daemon¦m(mdf¦ajordomo)¦n?uucp¦LIST(SERV¦proc)¦NETSERV¦o(wner¦ps)¦r(e(quest¦sponse)¦oot)¦b(ounce¦bs\.smtp)¦echo¦mirror¦s(erv(ices?¦er)¦mtp(error)?¦ystem)¦A(dmin(istrator)?¦MMGR¦utoanswer))(([^).!:a-z0-9][-_a-z0-9]*)?[%@> ][^<)]*(\(.*\).*)?)?$([^>]¦$)))"
procmail: Match on! "(^(((Resent-)?(From¦Sender)¦X-Envelope-From):¦>?From )([^>]*[^(.%@a-z0-9])?(Post(ma(st(er)?¦n)¦office)¦(send)?Mail(er)?¦daemon¦mmdf¦n?uucp¦ops¦r(esponse¦oot)¦(bbs\.)?smtp(error)?¦s(erv(ices?¦er)¦ystem)¦A(dmin(istrator)?¦MMGR))(([^).!:a-z0-9][-_a-z0-9]*)?[%@> ][^<)]*(\(.*\).*)?)?$([^>]¦$))"
procmail: Match on! "^X-Loop: address@mydomain.com"
procmail: Couldn't determine implicit lockfile from " (formail -t -r -A"X-Loop: address@mydomain.com " ; \
cat "Your message was tagged as spam and deleted. If it wasn't spam, please visit my website and send your mail through the form there." )\
¦ $SENDMAIL -t"
procmail: Locking ".lock"
procmail: Executing " (formail -t -r -A"X-Loop: address@mydomain.com " ; \
cat "Your message was tagged as spam and deleted. If it wasn't spam, please visit my website and send your mail through the form there." )\
¦ $SENDMAIL -t"
procmail: Assigning "LASTFOLDER= (formail -t -r -A"X-Loop: address@mydomain.com " ; \
cat "Your message was tagged as spam and deleted. If it wasn't spam, please visit my website and send your mail through the form there." )\
¦ $SENDMAIL -t"
procmail: Unlocking ".lock"
procmail: Notified comsat: "myaccount@:/home/myaccount/ (formail -t -r -A"X-Loop: address@mydomain.com " ; \
cat "Your message was tagged as spam and deleted. If it wasn't spam, please visit my website and send your mail through the form there." )\
¦ $SENDMAIL -t"
From john@johndoe.com Thu Jul 1 12:19:05 2004
Subject: from ms-pm
Folder: (formail -t -r -A"X-Loop: address@mydomain.com " 996