1# procmailrc.example 2# 3# This is a sample procmail setup file that 4# 1 - retains an unprocessed copy of all incoming mail 5# 2 - diverts incoming mail with asian character sets 6# 3 - runs bogofilter 7# 4 - retains a processed copy of all messages identified as spam. 8# 5 - retains a processed copy of all messages identified as unsure. 9# 10 11### bogofilter - filter & update word lists 12 13MAILDIR=/var/spool/mail 14BOGOFILTER_DIR=/var/spool/bogofilter 15 16#### testing #### 17## MAILDIR=/tmp/mail 18## MAILDIR=/home/user/filter/korean.spam/mail 19## procmail procmailrc < input.file ; echo $? ; ll -t $MAILDIR | head 20#### end testing #### 21 22 23#### backup #### 24:0c: 25mail.backup 26#### 27 28 29## Silently drop all completely unreadable mail 30:0: 31* 1^0 ^\/Subject:.*=\?(.*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987|windows-1251|windows-1256)\? 32* 1^0 ^\/Content-Type:.*charset="(.*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987|windows-1251|windows-1256) 33spam-unreadable 34#### 35 36 37#### bogofilter passthrough-update #### 38 39:0fw 40| bogofilter -p -u -l -e -v 41# -p)assthrough -u)pdate, -l)og -e)xitcode 0 for spam and ham 42# -v)erbose 43 44#### begin error catcher #### 45 46# m-a 2002-10-28 47# If bogofilter failed, return the mail to the queue. 48# Better put this after _EACH_ delivering recipe (not shown here). 49# Later, the MTA will try again to deliver it. 50# 75 is the value for EX_TEMPFAIL in /usr/include/sysexits.h 51# 52# Originally published by Philip Guenther on the postfix-users 53# mailing list. 54 55:0e 56{ 57 EXITCODE=75 58 HOST 59} 60 61#### end error catcher #### 62 63 64:0c: 65* ^X-Bogosity: (Spam|Yes) 66spam-bogofilter 67# put copy error catcher here to avoid fallthrough 68 69# unnecessary in twostate mode: 70:0c: 71* ^X-Bogosity: Unsure 72unsure-bogofilter 73# put another copy of error catcher here to avoid fallthrough 74 75#### end bogofilter passthrough-update #### 76 77 78#### SpamAssassin #### 79# :0c: 80# * ^X-Spam-Status: Yes 81# spam-spamassassin 82#### end SpamAssassin #### 83