>However it doesn't explain how to do do what I want. I want to check all
 >incoming messages to see if they're on DUL, ORBS, RSS, RBL or whatever
 >and if so add a header to the message, say an "X-Spam-Warning: DUL" or
 >the like. I know this is a trivial one line config option for Exim, but
 >I haven't seen anything for qmail to do this.
 >
 >I know I could do something with procmail, but I want this to work even
 >for mail that's being forwarded or stored in a Maildir or whatever,
 >without the user having to do anything special.
 >
 >Anybody any ideas?

I've written a system-wide mail filtering program I implemented that checks 
RBL, RSS, ORBS, and DUL.  It also looks at faked Message-ID headers.  Any 
message that fails a test is marked with [SPAM] on the subject line, and 
has X-Blacklisted header inserted for each of the tests it 
fails.  Precedence is set to junk.  Users can then decide what to do with 
the mail - bounce it or procmail it or whatever.

I run all incoming mail through this filter using the system default 
delivery instructions.  Users who don't have their own .qmail file can 
control how the filter works through the use of a ~/.qmail_rblcheck file: 
an empty file means don't check at all; a file with a line containing the 
flag "b" instructs the filter to bounce spam mail rather than redeliver it 
to the user; a line containing "l" instructs the filter to log actions to 
~/.qmail_rbllog; a line containing "l:/path/to/logfile" instructs the 
filter to log somewhere other than ~/.qmail_rbllog.

It uses another system tool, rblcheck, which is a command-line interface to 
DNS-style blacklists written by [EMAIL PROTECTED]

It also uses a small 4 line patch to qmail's received.c file to insert an 
X-Remote-IP header.  I was too lazy to figure out a robust way to do this 
with Perl, though the rblcheck tool does include some utilities for 
extracting this from qmail's "Received" header if you don't feel like 
patching the source.

If you're interested you can get this script, the rblcheck source, and the 
remoteip patch at http://will.harris.ch.  I haven't written any docs for 
the Perl script (apart from in this mail) and it'll need to be customised 
for the individual site that uses it, but it shouldn't be too difficult for 
someone familiar with Perl.

regards,
Will
__________________________________________________________________________

   "I was going to be a Neo-Deconstructivist, but Mom wouldn't let me..."

  multimedia laboratorium                              [EMAIL PROTECTED]
  institut fuer informatik                        (pgp id)        F703D035
  der universitaet zuerich                        (office) +41  1 635 4346
  winterthurerstr. 190                            (fax)    +41  1 635 6809
  ch-8057 zuerich                                 (mobile) +41 76 372 0913
  switzerland                                     www.ifi.unizh.ch/~harris
__________________________________________________________________________

Reply via email to