#A simple .procmailrc with Spamassasin .. hopefully works. VERBOSE=on LINEBUF=4096 PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin MAILDIR=$HOME/Maildir #make sure it exists DEFAULT=$MAILDIR/.INBOX/ LOGFILE=$HOME/procmail.log LOGABSTRACT=all # SpamAssassin sample procmailrc # ============================== # The following line is only used if you use a system-wide /etc/procmailrc. # See procmailrc(5) for infos on what it exactly does, the short version: # * It ensures that the correct user is passed to spamd if spamc is used # * The folders the mail is filed to later on is owned by the user, not # root. DROPPRIVS=yes # Pipe the mail through spamassassin (replace 'spamassassin' with 'spamc' # if you use the spamc/spamd combination) # # The condition line ensures that only messages smaller than 250 kB # (250 * 1024 = 256000 bytes) are processed by SpamAssassin. Most spam # isn't bigger than a few k and working with big messages can bring # SpamAssassin to its knees. # # The lock file ensures that only 1 spamassassin invocation happens # at 1 time, to keep the load down. # :0fw: spamassassin.lock * < 256000 | spamassassin # Mails with a score of 15 or higher are almost certainly spam (with 0.05% # false positives according to rules/STATISTICS.txt). Let's put them in a # different mbox. (This one is optional.) :0: * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* almost-certainly-spam # All mail tagged as spam (eg. with a score higher than the set threshold) # is moved to "probably-spam". :0: * ^X-Spam-Status: Yes probably-spam # Work around procmail bug: any output on stderr will cause the "F" in "From" # to be dropped. This will re-add it. # NOTE: This is probably NOT needed in recent versions of procmail :0 * ^^rom[ ] { LOG="*** Dropped F off From_ header! Fixing up. " :0 fhw | sed -e '1s/^/F/' } #DEFAULT=$MAILDIR/mbox ##optional #LOGFILE=$MAILDIR/procmaillog #SED=/bin/sed #LBDBFETCH=/usr/bin/lbdb-fetchaddr #MESSAGE="/usr/local/bin/gmsgp --no_hscrollbar -f -" FORMAIL=/usr/bin/formail SENDMAIL=/usr/sbin/sendmail #Nuke duplicate messages from people cross-posting to several mailing-lists #duplicates go into separate folder which has to be periodically emptied :0 Whc: msgid.lock | $FORMAIL -D 8192 msgid.cache #:0 a: #duplicates #Create a backup cache of 200 most recent messages in case of #mistakes (can change 200 to 20 or 400 or whatever ...) :0 c backup :0 ic | cd backup && rm -f dummy 'ls -t msg.* | sed -e 1,200d' #Store mail from postmaster or mailer-daemon into file 'bounced' #using file 'bounced.lock' as locallockfile :0: * ^FROM_MAILER bounced #Regenerate "From" lines to make sure they are valid #:0 fhw #|formail -I "From " -a "From" #RECIPES :0: * ^From(_dot_)*andybogacki(_at_)bogacki(_dot_)co(_dot_)nz Andrew :0: * ^From(_dot_)*antos(_at_)lederzentrum(_dot_)de * ^From(_dot_)*abogacki(_at_)lederzentrum(_dot_)de * ^From(_dot_)*antbogacki(_at_)netscape(_dot_)net Antos :0: * ^From(_dot_)*aliciapower(_at_)dodo(_dot_)net(_dot_)au Alicia :0: * ^From(_dot_)*anatoleb(_at_)ais(_dot_)ac(_dot_)nz> * ^From(_dot_)*treter(_at_)internet(_dot_)co(_dot_)nz Anatol :0: * ^From(_dot_)*boco(_at_)paradise(_dot_)net(_dot_)nz Alex&Gillie :0: * ^From(_dot_)*anowakowski(_at_)hotmail(_dot_)com Andrzej :0: * ^X-Mailing-List: .*debian-\/[^ ]*(_at_)lists(_dot_)debian(_dot_)org { LIST=`expr match $MATCH '\(.*\)\@' | sed s/-/./` :0: debian.$LIST { :0: * ^From.*debian-user-digest DebianUserDigest :0: * ^From.*debian-user-polish DebianUserPolish :0: * ^From.*slug Slug :0: * ^From.*wellylug Wellylug :0: * ^Subject:.*mutt-users-digest Mutt-users :0: * ^From(_dot_)*procmail-request(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE Procmail-users :0: * ^From(_dot_)*athofsv(_at_)yahoogroups(_dot_)com Athofsv :0: * ^From.*"News Alert - smh.com.au" SMH_newsalert :0: * ^Subject:.*Google News Alert - intelligence analysis Intelligence_newsalert :0: * ^From.*IHT News Alert IHT_newsalert :0: * ^Subject:.*SEEK Job Mail SEEK_jobmail :0: * ^From.*Nature NATURE :0: * ^From.*BRW BRW :0: * ^From.*AFR AFR :0: * ^From.*OECD OECD :0: * ^From(_dot_)*alert(_at_)stratfor STRATFOR :0: * ^Subject:.*SCOOP SCOOP :0: * ^From.*CommonwealthFund Commonweath_Fund :0: * ^From.*ABC Science * ^Subject:.*ABC Science Science_ABC :0: * ^From.*ABC Health * ^Subject:.*ABC Health Health_ABC :0: * ^From.*Medscape Psychiatry Psychiatry_Medscape :0: * ^From.*science-mailer Science_AAAS