# procmail.rc # == # This document: http://www.rdrs.net/document/ # Last update: Wed Mar 23, 2004 # == ##### # Please check if all the paths in PATH are reachable, remove the ones that # are not. PATH=$HOME/bin:/usr/bin:/bin:/usr/local/bin:. MAILDIR=$HOME/mail LOCKFILE=$HOME/.lockmail # Debugging options LOGFILE=$MAILDIR/.procmail.log # VERBOSE=off # LOGABSTRACT=All # # Some catch all's... # # Unable to deliver, recipient unkown etc.. :0 * ^FROM_MAILER error # storage: one message, one file. # Keep a copy of the full message :0 c allmail/full/. # storage: one message, one file. # Only save the message bodys. :0 cb allmail/body/. # # another catch all, consists of 2 recipes.. # 1. save all messages in my_bckp_mail_dir # :0 c my_bckp_mail_dir # 2. and only keep the newest 50 messages... :0 c | cd my_bckp_mail_dir && rm -rf NOTHING `ls -1t msg.* | tail +50` # # compress and backup all to mailling.lists in a separate file :0 c * ^TOmailling.lists | gzip -9c >> mailling_lists.gz # take care of those empty messages :0 B * ! . . . /dev/null # save all send to webmaster postmaster :0 * ^To:.*(webmaster|postmaster)@foo.net www.foo.net/webmaster # anything not to lists.. but from chrisis :0 * ^From.*@(chrisis|jallablafoo).(nl|net) * ! *@lists.unllg.tk jastra/chrisis # save all messages greater as 1mb to backupfile.tgz # and send a message announcing it.. :0 * > 1048576 { :0 c | gzip -9c >> ${HOME}/backupfile.tgz :0 h | (cat -; echo "Saved a message to backupfile.tgz") >> ${DEFAULT} } :0 * ^Sender:.*linux-gcc-owner@vger.kernel.org * ^X-Mailing-List:.*linux-gcc@vger.kernel.org linux/vger-kernel-gcc :0 *@marnagaresearch.gov newsletter/www.marnagaresearch.gov # give mailing-list flamer a new home in the bitbucket :0 * ^TOprocmail * ^From.*(mister|flamer.com|alias@flame2.tk) /dev/null # # a few spam filters... # # send all messages greater as 1mb to the bitbucket :0 * > 1048576 /dev/null # send all matches into the bitbucket :0 *X-XS4ALL-DNSBL-Warning /dev/null :0 * ^X-UIDL: * !^X-UIDL:[ ]*[0-9a-f]+[ ]*$ spam/spam-invalid-x-UIDL # check for invalid message id, and mark the message accordingly :0 * ! ^Message-Id: [ ]*<[^ <>@]+@[^ <>@]+[ ]*$ | formail -b -f -A"X-span-check: bad message-id" # Anything that has not been delivered (or survived??) by now will go to $DEFAULT # using LOCKFILE=$DEFAULT$LOCKEXT # END OF PROCMAILRC # Here's a list of some usefull related commands. # count messages # ~: formail -s echo < ~/mail/inbox | wc -l # print all the from addresses # ~: formail -Y -czxFrom: -s < ~/mail/spam