Mailfilterrc

Here's what a typical rcfile could look like. You can copy and paste this and then modify it to your own needs. The following example is just to get you started as quick and convenient as possible. Place it in your home directory, e.g. if your username was 'tux' then /home/tux/.mailfilterrc

Generally the rcfile is not case-sensitive, which means it does not matter whether the keywords are spelled in capitals or not. You can place white space characters before and in between a command and its parameters. It is very important though to not mix up the order in which you specify your POP3 accounts: First comes 'SERVER', followed by 'USER', then 'PASS' and 'PROTOCOL' and finally 'PORT' which is usually 110, unless you know specifically otherwise.


 * 1) Logile path (be sure you have write permission in this
 * 2) directory; you MUST specify a logfile).  This one auto-
 * 3) matically stores the log files sorted by month and year.
 * 1) matically stores the log files sorted by month and year.

LOGFILE = "$HOME/logs/mailfilter-`date +"%h%y"'"


 * 1) Level of verbosity
 * 2) 0  Silent, show nothing at all
 * 3) 1  Only show errors
 * 4) 2  Only show "Deleted..." messages and errors
 * 5) 3  Default; Show "Deleted..." messages, errors and
 * 6)    "Examining..." messages
 * 7) 4  Like (3), except this also shows the current
 * 8)    account's username
 * 9) 5  Like (4), except this also shows which filter
 * 10)    matched which string of an e-mail header
 * 11) 6  Debugging mode; prints out almost everything
 * 1) 4  Like (3), except this also shows the current
 * 2)    account's username
 * 3) 5  Like (4), except this also shows which filter
 * 4)    matched which string of an e-mail header
 * 5) 6  Debugging mode; prints out almost everything
 * 1)    matched which string of an e-mail header
 * 2) 6  Debugging mode; prints out almost everything
 * 1) 6  Debugging mode; prints out almost everything

VERBOSE = 3


 * 1)               Test our Setup                     #####
 * 2) This makes sure you are not losing any mail at all, including spam.
 * 3) When Mailfilter is in test mode it only simulates the deletion of
 * 4) e-mail and you can see how good your filters would work - in theory.
 * 5) Once you have come to a point where you are happy about their behaviour
 * 6) you can remove this command from your rcfile again and start to seriously
 * 7) kill the spam.
 * 1) you can remove this command from your rcfile again and start to seriously
 * 2) kill the spam.

Test = yes


 * 1) SHOW_HEADERS = yes


 * 1) POP server list (do not change the order of the fields!)
 * 2) Note: Port 110 is usually the port APOP/POP3 servers use.
 * 3) When SSL comes into play, then it is usually 995.
 * 1) When SSL comes into play, then it is usually 995.

SERVER  = "pop.server.com" USER    = "username" PASS    = "password" PROTOCOL = "pop3" PORT    = 110

SERVER  = "pop.secondserver.com" USER    = "anotherusername" PASS    = "anotherpassword" PROTOCOL = "pop3/ssl" PORT    = 995

SERVER  = "apop.server.com" USER    = "yetanoterusername" PASS    = "yetanotherpassword" PROTOCOL = "apop/ssl" PORT    = 995


 * 1) Do you want case sensitive e-mail filters? { yes | no }
 * 1) Do you want case sensitive e-mail filters? { yes | no }

REG_CASE = "no"


 * 1) Sets the type of Regular Expression used { extended | basic }
 * 2) (The default is 'basic', don't change unless you know what
 * 3) you are doing. Extended REs are more complex to set up.)
 * 1) (The default is 'basic', don't change unless you know what
 * 2) you are doing. Extended REs are more complex to set up.)

REG_TYPE = "basic"


 * 1) Maximum e-mail size in bytes that should not be exceeded.
 * 1) Maximum e-mail size in bytes that should not be exceeded.

MAXSIZE_DENY = 1000000


 * 1) Filter rules for detecting spam (each rule must be placed
 * 2) in a seperate line)
 * 1) in a seperate line)

DENY = "^Subject:.*Get penis enlargement" DENY = "^Subject:.*WIN MONEY"
 * 1) These filters detect certain unpleasant e-mail subjects:

DENY = "^From:.*spammer@any_spam_organisation.com"
 * 1) This one filters mail from a certain person:

DENY = "^From:.*@any_provider_that_spams.org"
 * 1) This one filters mail from everyone at a certain
 * 2) organisation:

DENY_CASE = "^Subject:.*LEGAL"
 * 1) We don't want any of those 'LEGAL' messages either
 * 2) while stuff with 'legal' in the subject still interests us:


 * 1) Normalises the subject strings before parsing, e.g.
 * ',L.E-G,A.L; ,C.A-B`L`E, +.B-O`X` ;D`E`S,C;R,A.MB;L,E.R-]'
 * 1) becomes 'LEGAL CABLE BOX DESCRAMBLER' which can be filtered.
 * 1) becomes 'LEGAL CABLE BOX DESCRAMBLER' which can be filtered.

NORMAL = "yes"


 * 1) The maximum e-mail size in bytes that messages from friends
 * 2) should not exceed. Set this to 0 if all your friends (ALLOW)
 * 3) can send messages as long as they want.
 * 1) can send messages as long as they want.

MAXSIZE_ALLOW = 0


 * 1) Set list of friends that always pass, if they do not
 * 2) exceed the message length of MAXSIZE_ALLOW
 * 1) exceed the message length of MAXSIZE_ALLOW

ALLOW = "^From:.*a_friend_with_account@any_provider_that_spams.org"
 * 1) This rule allows all mail from a friend who was unlucky
 * 2) enough to have signed up with a spam organisation. With DENY
 * 3) we block everyone else from that domain though! See above!

ALLOW = "^Subject:.*mailfilter"
 * 1) Of course we allow e-mail from anyone who has something to
 * 2) say about mailfilter:

ALLOW = "^From:.*my_girlfriend@any_provider.com"
 * 1) We also let our girlfriend send any e-mail she wants: