[Mailman-Developers] anti-spam filter

Barry Warsaw barry at list.org
Fri Apr 19 16:30:44 CEST 2013


On Apr 19, 2013, at 10:28 AM, Stephen J. Turnbull wrote:

>Barry Warsaw writes:
>
> > I still think this wouldn't be a handler, but a rule.
>
>Is this distinction implemented and enforced by the API?

It is.  There are two distinct interfaces, IHandler and IRule, with different
signatures.  It's also enforced by design and implementation, since rules are
generally attached to actions via links in a chain and get executed during
incoming processing, whereas handlers are processed sequentially without
interruption, and only after the message has been accepted for posting.

>If not, it's going to be hard to persuade myself to make the distinction in
>discussion.  Ie, I'll probably just go on calling everything a Handler unless
>somebody asks "don't you really mean a Rule?"

There are several ways to think about it, but I guess the easiest one is "does
this chunk of processing change the message or make a non-destructive
moderation decision?"  Or more simply, "is it moderation or modification?"

If it's moderation, then it's a rule.  If it's modification then it's a
handler.  (There are some corner cases in each, but it's a good general
distinction.)  Thus a chunk that asks "does this message contain
administrivia?" is a moderation question and thus a rule.  A chunk that
adds an informative footer to the message is a modification handler.

Aside: I wanted to find a better name than "handler" for the modification
bits, but I failed.  I would have rather done away with the term "handler" in
MM3 so suggestions are welcome for the term naming the units that plug into
the modification pipeline.

The interfaces are important too because MM3 initialization will auto-discover
both rules and handlers and stick them in different collections.  If we ever
expose this in the REST API, then you would be able to compose them in
different ways, appropriate for the interface.

Hope that helps.
-Barry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/mailman-developers/attachments/20130419/7ac0c53d/attachment-0001.pgp>


More information about the Mailman-Developers mailing list