lists.mysql.com has been switched over to be qpsmtpd-powered. it's also
using (a hacked up) sql_maillog to logs its activity.
attached is a patch to the spamassassin plugin to get it working with
2.51. this attaches 'X-Spam:' and 'X-Spam-Checked-By' headers. (this was
a new install, so i didn't try to preserve the old X-Spam-Status header.
should be a trivial bit of code to turn the X-Spam header into that. and
i wasn't interested in figuring out how to get the various report fields
included as headers. it would be interesting to be able to log them,
though, so i may poke around with that.)
note that it plays fast-and-loose with the spamd return codes, but that
should not result in any loss of mail, just a loss of spam checking.
(and of course, i offer no guarantee that this will work for anyone
else. works for me(tm).)
jim (surprised by the amount of spam bouncing off the -(un)?subscribe
addresses. sheesh.)
Index: plugins/spamassassin
===================================================================
RCS file: /cvs/public/qpsmtpd/plugins/spamassassin,v
retrieving revision 1.5
diff -r1.5 spamassassin
0a1
> #!/usr/bin/perl
105,106c106,107
< print SPAMD "REPORT_IFSPAM SPAMC/1.0" . CRLF;
< # or CHECK or REPORT or SYMBOLS
---
> print SPAMD "CHECK SPAMC/1.2" . CRLF;
> # or REPORT or SYMBOLS
108c109,117
< print SPAMD join CRLF, split /\n/, $transaction->header->as_string
---
> my $headers = join CRLF, split /\n/, $transaction->header->as_string;
>
> print SPAMD "Content-length: ", length($headers) + $transaction->body_size + 2 ,
> CRLF;
>
> # XXX send user?
>
> print SPAMD CRLF;
>
> print SPAMD $headers
115,116c124
< chomp $line;
< print SPAMD $line, CRLF
---
> print SPAMD $line
122a131,133
>
> # XXX actually deal with response code like 'SPAMD/1.1 0 EX_OK'
>
128c139
< #warn "GOT FROM SPAMD1: $_";
---
> warn "GOT FROM SPAMD1: $_";
131c142
< my @h = split /: /, $_, 2;
---
> my @h = split /: /, "X-$_", 2;
135d145
<
167,168c177,178
< my $status = $transaction->header->get('X-Spam-Status') or return;
< my ($score) = ($status =~ m/hits=(\d+\.\d+)/)[0];
---
> my $status = $transaction->header->get('X-Spam') or return;
> my ($score) = ($status =~ m#([-\d.]+)\s*/\s*\d+#)[0];