Published 2004-06-27 12:16:57

Probably like Sterling and almost all my clients, spam is a huge problem. A couple of years ago I started using exim4 with eximscan-av (an excellent set of tools), and configured it so:

  • no .pif/.exe/....
  • clamav (removes all remainng virus emails, like zips)
  • No HTML only emails (or messages without text/plain)
  • No korean / chinese subjects.
  • No Multipart messages to my @php.net address.
  • Some attempt at blocking virus bounces..
This achieved pretty good results It originally caught about 300 out of 340 spams per day. (and lets through 200-400 good messages). However after a while it became clear that a few spammers had realized that some people did this, and they started sending plain text spam.., so the number getting through slowly increased.

About a year ago, I decided that IP blacklisting was really the only other solution. So I wrote an exim Log parser, along with adding the Subject to the message log line, this enabled me to quickly scan and blacklist IP's on a daily basis, on average I blacklisted about 10-20 a day. However with the advent of the virus spammers, this began to seem like a neverending task..

In an effort to fight back, I finally rewrote the blacklist parser code, and rejigged exim a little.

  • any incomming email (IP) that is not 'greylisted' or 'whitelisted', is defered.
  • once a day, A cron job parses the log, look at the defer messages, and compare the email From address to the IP
    • If they are close (eg. same Class B) - it gets greylisted.
    • If there is no match whatsoever, (fake from domain etc.), it gets instantly blacklisted.
    • All virus IP's are auto blacklisted
    • All HTML email senders are auto blacklisted
  • once in a while, I check the parser web page, which lists all the emails recieved in the greylist, and white or blacklist them manually..


The solution is not perfect however, as it does depend heavily on me having created a good whitelist to start with, and for @php.net mail servers not to change to often (as they did recently, and got blacklisted accidentally by me, on the old manual system). But all these minor irritants, are not as bad as the alternative, having to wade through a ton of spam everyday..

The end result, About one spam per day (usually a nigerian scam one, via a freemail service) and I still get the occasional project enquiry (delayed by a day)..

Such a shame I miss out on all those fantastic offers for viagra...




Mentioned By:
google.com : exim log parser (81 referals)
google.com : april (64 referals)
google.com : december (61 referals)
google.com : php spam (54 referals)
blog.akbkhome.com : AKBK home - Smoking toooooo much PHP - Spam from 400 to 1 per day... (29 referals)
akbkhome.com : AKBK home - Smoking toooooo much PHP (20 referals)
google.com : exim blacklist (16 referals)
google.com : exim log viewer (16 referals)
google.com : exim4 blacklist (11 referals)
google.com : exim blacklist ip (10 referals)
google.com : exim4 log parser (9 referals)
google.com : exim log spam (8 referals)
google.com : exim log parse (7 referals)
google.com : eximscan (6 referals)
google.com : php exim log (6 referals)
google.com : exim log parse php (5 referals)
google.com : php exim (5 referals)
google.com : "PHP spam" (4 referals)
google.com : exim log parsing php (4 referals)
google.com : parse exim log (4 referals)

Add Your Comment

Follow us on