Event::Lib and p0f-dnsbl

gav on 2004-08-28T01:21:22

I've been playing about with Event::Lib (a wrapper around libevent) this evening and having great fun. It makes handing multiple filehandles a piece of cake by specifying event handlers that get triggered. It also supports timers.

The reason I'm doing this is that I had an idea to use p0f, a passive OS fingerprinting tool, to record the IP and platform of each connection to my SMTP server, and then query this as if it was a local DSNBL in SpamAssassin. My thinking is that a lot of spam is going to come from Windows boxes and giving them a SA score will help cut down on the spam that gets through. Over 95% of the email I get is now spam.

In about 100 lines of code I've got the majority of this done, all I have to do is figure out is how to return valid DNS records using Net::DNS...