On Mon, 2010-08-30 at 14:29:13 -0400, Wietse Venema wrote: > Victor Duchovni: > > On Mon, Aug 30, 2010 at 01:06:28PM -0500, Stan Hoeppner wrote: > > > > > Is there a straightforward (i.e. relatively painless) way to check the > > > header from, reply-to, and message-id domains against dbl.spamhaus.org > > > and reject on a positive reply as with reject_r*bl_client? > > > > Not from Postfix. There is currently no support in cleanup(8) > > for extracting domains from headers and applying RBL checks. The > > Postfix SMTP server does not look at the message content. > > Some courageous person could implement this as: > > header_checks = tcp:127.0.0.1:port > > and write a Perl script that rips domain names from headers and > runs them through dbl lookups. > > I don't have time, but with Net::DNS this should involve no more > than a dozen lines of code (using the spawn(8) daemon for connection > management). As a stand-alone program, maybe two dozen lines.
A quick n' dirty attempt is attached and also posted[1] on the web. Stan already uncovered a few errors in earler iterations, and I'm sure the Perl monks among us will cringe at the code. Completely unprepared for production and only for experimentation; the typical boilerplate caveats apply. [1] http://people.freebsd.org/~sahil/scripts/checkdbl.pl.txt -- Sahil Tandon <sa...@freebsd.org>
checkdbl.pl
Description: Perl program