[Mailman-Developers] [ mailman-Patches-534577 ] Add SpamAssassin filter to mail pipeline

noreply@sourceforge.net noreply@sourceforge.net
Wed, 12 Jun 2002 14:48:05 -0700


Patches item #534577, was opened at 2002-03-25 08:17
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=300103&aid=534577&group_id=103

Category: list administration
Group: Mailman 2.0.x
Status: Open
Resolution: None
Priority: 5
Submitted By: James Henstridge (jhenstridge)
Assigned to: Nobody/Anonymous (nobody)
Summary: Add SpamAssassin filter to mail pipeline

Initial Comment:
This filter adds support for discarding or holding spam
sent to the mailing list.  It contacts a spamd daemon
(from SpamAssassin -- http://spamassassin.taint.org) to
score the message.

If the score is above a certain threshold (default 10),
the message is discarded and an entry is written to the
vette log.

If the score is above another lower threshold (default
5), the message is held for moderation.

The SpamAssassin.py file should be installed in
Mailman/Handlers/.  The LIST_PIPELINE variable in
Mailman/Handlers/HandlerAPI.py should be modified to
include a 'SpamAssassin' item (I put it just after the
existing 'SpamDetect' item).

To change the defaults, the following can be added to
the mm_cfg.py file:
  SPAMASSASSIN_HOST = 'host:port'  # how to contact SA
  SPAMASSASSIN_DISCARD_SCORE = 10
  SPAMASSASSIN_HOLD_SCORE = 5

If you don't want to discard messages, then
DISCARD_SCORE can be set to something very high (1000
should do it).

It looks the MM2.1 filter APIs have changed a bit, so
this filter will need some modifications to work with
that version.  When I get round to upgrading, I might
look into updating it.


----------------------------------------------------------------------

Comment By: Sean Reifschneider (jafo)
Date: 2002-06-12 21:48

Message:
Logged In: YES 
user_id=81797

FYI: I've been running the 2002-05-14 version of this patch
with spamassassin 2.20 for the last day on our main mailman
box and it seems to be working great.

----------------------------------------------------------------------

Comment By: James Henstridge (jhenstridge)
Date: 2002-05-14 06:04

Message:
Logged In: YES 
user_id=146903

This version is essentially the same as the previous
version, but adds compatibility with python > 1.5.2, which
doesn't like you passing two arguments to socket.connect().

----------------------------------------------------------------------

Comment By: James Henstridge (jhenstridge)
Date: 2002-04-27 06:17

Message:
Logged In: YES 
user_id=146903

Just attached my updated version of the patch.  This version
requires SpamAssassin 2.20 (for the extra commands that the
spamd daemon understands).  It now displays a list of which
rules were triggered for held messages, and can give
messages from list members a bonus (defaults to 2), so that
they are less likely to get held as spam.

----------------------------------------------------------------------

Comment By: James Henstridge (jhenstridge)
Date: 2002-03-26 01:21

Message:
Logged In: YES 
user_id=146903

There is a fairly easy optimisation for this filter that I
missed when writing it.  It calls str() on the message
object twice.  It would be quicker to call str() on the
message once.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=300103&aid=534577&group_id=103