spamhammerd

spamhammerd is a simple perl script to help combat spammers. spammers are generally sloppy, and tend to blast every address they know of on your mail server at the same time, even if they don't exist. spamhammer watches your logfile (currently works only with postfix) and dynamically creates an accessfile. connections are tracked, and every time a client attempts to send to an unknown user, the counter is incremented. when the threshold is crossed, the ip is blocked for a configurable length of time!

i realize that this may sound way too simple to be effective, but in working with a large mailfarm, the worst spammers tend to be "throwaway" dialup or dsl users who can send an amazing amount of garbage in a short period of time. our block list on any given smtp server usually hovers around 5000 lines.

to use, simply add:

check_client_access hash:/etc/postfix/generated/spammers

to your postfix configuration. edit the variables in the top of this script to your liking, and start hammering spammers.

get it here