# mailfilter.example
#
# This is a sample maildrop configuration file which shows some ways
# of running bogofilter from maildrop.

### bogofilter - filter & update word lists

MAILDIR=/var/spool/mail
BOGOFILTER_DIR=/var/spool/bogofilter

#### backup ####
cc "mail.backup"
####

## Silently drop all completely unreadable mail into separate folder
if (/^Subject:.*=\?(.*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987|windows-1251|windows-1256)\?/ || /^Content-Type:.*charset="(.*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987|windows-1251|windows-1256)/)
to "spam-unreadable"
####


#### bogofilter passthrough-update ####

xfilter 'bogofilter -p -u -l -e -v'

# if spam, file this into the "spam-bogofilter" folder and exit
# processing
if (/^X-Bogosity: (Spam|Yes)/)
to "spam-bogofilter"

# if unsure, copy this into the "spam-bogofilter" folder and
# CONTINUE processing
if (/^X-Bogosity: Unsure/)
cc "unsure-bogofilter"
#### end bogofilter passthrough-update ####


#### SpamAssassin ####
# if spamassassin detects spam (this example assumes spamd is running),
# teach bogofilter about it (avoiding to register spamassassin markup)
# and store it to spam-spamassassin
xfilter "/usr/bin/spamc"
if (/^X-Spam-Status: YES/)
{
    cc "|/usr/bin/spamassassin -d -L|bogofilter -s"
    to "spam-spamassassin"
}
#### end SpamAssassin ####
