### basic settings SHELL=/bin/sh PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin COMSAT=no LINEBUF=16384 UMASK=0077 PMVAR=$HOME/.var/procmail MAILFILT=$HOME/.etc/mailfilter PMRULES=$PMDIR/rules CONF=$MAILFILT/config REPLIES=$MAILFILT/autoreplies LOGFILE=${LOGFILE:-$PMVAR/log} LOGABSTRACT=no #NICE='/usr/bin/nice -20' PROCMAIL="$NICE /usr/bin/procmail -p $PMDIR/procmailrc" FORMAIL="$NICE /usr/bin/formail -f" EGREP="$NICE /bin/egrep" SED="$NICE /bin/sed" DELIVER="$NICE /usr/lib/dovecot/deliver" CRM114="$NICE /usr/share/crm114/mailreaver.crm -u $MAILFILT/crm114/" SA_PREFS="$MAILFILT/spamassassin/user_prefs" SPAMASSASSIN="$NICE /usr/bin/spamassassin -p $SA_PREFS" SPAMC="$NICE /usr/bin/spamc -lx" #SPAMC="$SPAMASSASSIN" TRAINER="$MAILFILT/bin/train" OURDATE=`date -R` OURDATE_SHORT=`date +%Y.%m.%d.%H.%m.%N` INBOX=$HOME/.maildir #DEFAULT="|$DELIVER" DEFAULT=$INBOX/ ORGMAIL=$HOME/BOUNCED-MAIL # maximum message size for spam checking SPAMCHECK_MAX_MESSAGE_SIZE=2500000 # if crm114 is unsure and SA returns a score less-than-or-equal to this, # autotrain crm114 with ham CRM_UNSURE_SA_AUTOTRAIN_LIMIT_HAM=2.0 # if crm114 classifies a message as spam but SA returns a score # less-than-or-equal to this, retrain crm114 CRM_MISCLASSIFY_SA_AUTOTRAIN_LIMIT_HAM=-1.0 # if crm114 is unsure and SA returns a score greater than this, autotrain # crm114 with spam CRM_UNSURE_SA_AUTOTRAIN_LIMIT_SPAM=8.0 # if crm114 classifies a message as ham but SA returns a score # greate than this, retrain crm114 CRM_MISCLASSIFY_SA_AUTOTRAIN_LIMIT_SPAM=11 ### constants used in rules NL=" " RE_MYDOMAIN="(.+\.)*madduck\.net" RE_MAILRELAYS="(seamus|clegg)\.madduck\.net" RE_SPACE_NEWLINE="(^|[ ])" RE_FIRSTNAME="martin($RE_SPACE_NEWLINE+f(\.?|elix))?" RE_LASTNAME="kraff?t" RE_EXTRACT_HEADER_VALUE="[ ]*\/[^ ].*" NULL=/dev/null DISCARD=$INBOX/.discard/ #DISCARD="'|$DELIVER -m INBOX.discard'" ### variables from the message ### local recipient data # user+foobar@my.domain.org # < > $USER # < > $EXTENSION # < > $LOCAL # < > $DOMAIN # < > $RECIPIENT USER="${USER:-$LOGNAME}" EXTENSION="${EXTENSION:-}" LOCAL="${LOCAL:-$USER${EXTENSION:++$EXTENSION}}" HOSTNAME="`hostname --fqdn`" DOMAIN="${DOMAIN:-$HOSTNAME}" RECIPIENT="${RECIPIENT:-$LOCAL@$DOMAIN}" ID="$LOGNAME@$HOSTNAME" # message-id INCLUDERC=$PMDIR/get-msgid # if $SENDER is undefined or not an email address, get it from the message :0 * !SENDER ?? @ *$ ^Sender:$RE_EXTRACT_HEADER_VALUE { SENDER="$MATCH" } :0 *$ ^Date:$RE_EXTRACT_HEADER_VALUE { DATE="$MATCH" } :0 *$ ^From:$RE_EXTRACT_HEADER_VALUE { FROM="$MATCH" } :0 *$ ^Subject:$RE_EXTRACT_HEADER_VALUE { SUBJECT="$MATCH" } # TODO: can be removed as soon as albatross is out of the loop :0 fw * ^X-Original-To-Saved: \/.* |$FORMAIL -R X-Original-To-Saved X-Original-To :0 *$ ^X-Original-To:$RE_EXTRACT_HEADER_VALUE { ORIGINAL_TO="$MATCH" } :0 E { LOG="NO ORIGINAL_TO: $MSGID" } # fix variable values for special cases INCLUDERC=$PMDIR/normalise :0 * ORIGINAL_TO ?? ^\/[^@]+ { ORIG_LOCAL="$MATCH" } :0 * ORIGINAL_TO ?? .+@\/.+ { ORIG_DOMAIN="$MATCH" } ### run-time variables # REPROC_MESSAGE # a procmail-style flag, which is true if unset and false if set (to !). # unset by marknew if the message has already been seen by the filter (according # to the X-Been-There header). REPROC_MESSAGE=! # SKIP_SPAMCHECKS # if set, cuases spamchecks to be skipped, value lists reason SKIP_SPAMCHECKS # SPAMTRAPPED # set by spamtrapped and eqdomains and used to bypass spamchecks and handle as # spam immediately. The value identifies who unset the variable. SPAMTRAPPED # IS_SPAM # if set, then the mailfilter is as sure as it gets that the message is spam. # The value identifies who set the variable. IS_SPAM # SPAM_DISAGREE # if set, then the various spamchecks disagree about spaminess of the mail. # The value can hold additional information. SPAM_DISAGREE # SPAM_UNSURE # if set, then the various spamchecks are unsure about spaminess of the mail. # The value can hold additional information. SPAM_UNSURE # SPAM_UNKNOWN # if set, the spamchecks were skipped. The value gives the reason for # skipping. SPAM_UNKNOWN # RETRAIN # if set, causes spamfilters to be retrained, according to the variable's value RETRAIN