Spam filtering at the jeroen.se domain
By Jeroen van Nieuwenhuizen
The jeroen.se spam defense consist of 3 levels:
- The firewall
- The MTA Level
- The User Level
The firewall
The first layer of defense against spam for the jeroen.se network is the
passive OS fingerprint capabilities of pf. This is used to make it impossible
for windows machines to connect to the primary MX of the jeroen.se network. On
average this stops between 600 an 1200 spam and virus messages a day, without
losing any legitimate mail. Every legitimate email from windows machines is
coming in via the secondary MX.
Below you can see a graph of the amount of spam that is blocked, for 1
emailaddress during a test in september 2004. The firewall blocking was turned
of on the 12th in the morning and put back on on the 19th in the afternoon.
The MTA level
At the MTA level several methods are applied to stop the incoming spam
stream as early as possible.
Client restrictions
The first checks are checks on the IP and hostname of the
client and whether what the host claims to be is correct.
First all messages from hosts falsely claiming to be a host in the jeroen.se
domain in the HELO command are rejected.
Secondly all messages from hosts that are explicitly blocked, because
they do not respond to abuse messages, are rejected.
Also mail to know generated jeroen.se mail addresses is rejected. i.e. spammers
came up with the checken.devnull@jeroen.se email address, so mail to that
address is rejected.
Finally a check is made against blacklist.jeroen.se, which lists known
spam sending hosts. If a host is listed in this blacklist all messages from
that host are rejected. We will come back to the issue of filling this
blacklist later.
Sender restrictions
After the client based checks, the sending mailaddress is checked. If the
domain of the mailaddress has no A or MX record the mail is rejected.
Recipient restrictions
Finally the MTA checks whether mail may be send to the recipient. When no mail
is allowed to the given recipient the mail is rejected. This feature is mainly
used to stop company's which sell my mailaddress, after I bought
something from them.
Connection rate limits
At the MTA level there is also a connection rate limit of 10 connections/5
minutes. This is mainly intended to stop huge amount of viruses from infected
machines like this one.
The User level
At the user level the mail is split into three seperate streams with procmail:
- Mail send to a spamtrap
- Mail containing a virus
- The rest
Mail send to a spamtrap
Mail send to a spamtrap is handed over to the spamikaze
instance of blacklist.jeroen.se to block the host asap from sending any more
mail. A copy of this spam is also send to bogofilter to automatically train
bogofilter.
Mail containing a virus
Mail containing a virus is handed over to the spamikaze instance of
blacklist.jeroen.se to block the host asap from sending any more mail.
The rest
The rest of the incoming mail is handed over to bogofilter. If bogofilter marks
a message as spam it is send to the spam box. Otherwise it is routed to the
correct inbox.
Bogofilter training
Once a day bogofilter is retrained on the ham and spam archives to improve the
performance.
|