[Mailman-Developers] Moderation rules priority

Barry Warsaw barry at list.org
Thu Mar 13 02:59:50 CET 2014


On Mar 12, 2014, at 01:43 PM, Stephen J. Turnbull wrote:

>Offhand I'd say that having both a Member rule and a NonMember rule is
>a bad idea.  There should be one conceptual test: can we identify a
>member as the originator of this post?  Having Member and NonMember
>rules that can both "succeed" is not coherent.

I agree, in theory, but there are two reasons I split these.  At first there
was only a membership rule, and the non-member rule was added later.  But more
importantly, there *is* an implicit ordering, not through the rules (which
there can't be), but through the chain in which these rules are links,
specifically the default-posting-chain.

Rules either hit or miss, they are pure binary tests.  By side-effect, both
the member rule and non-member rule set two message metadata keys,
'moderation_action' and 'moderation_sender', and of course the two rules set
them differently depending on the defaults and such.

It's the moderation chain that looks at these metadata keys and actually
performs the moderation action *if* the rule hits.  The moderation chain can
be jumped to if the member moderation rule hits, which happens early in the
chain, or the non-member rule hits, which happens later in the chain.  Think
of it like this: if the membership rule hits (i.e. the sender is a member),
then we can (but don't necessarily have to) bypass checks like administrivia
or implicit destination.  This might be the case if I were to configure my
list to say "All messages sent by Steve should be accepted without question".

By default, we'll probably defer if the membership test hits, so that we
normally do perform the other rule checks.

Toward the end of the chain, we do the non-member check.  Let say the message
has passed all other rules and it would normally be okay to post, but it comes
from a non-member.  If the rule hits, we'll again jump to the moderation
chain, taking whatever action is appropriate.  Usually this will be the
default non-member action, but we could potentially do something else, like
say "Even though Alice isn't a member of this list, we've seen her posts
before and they are on-topic, so let's accept them", or "Bob is a spammer,
always discard his messages".

The default posting chain has one final link, which has the 'truth' rule
(i.e. it always matches).  Thus let's say that the poster is a member with a
deferred posting action, and none of the other rules hit, so his message gets
sent to the 'accept' chain where it is accepted for posting and gets further
processed.  The same ultimate result could happen if the poster is a
non-member, but the default non-member rule is to accept posts from anybody.

I'm having a hard time right now seeing how we could continue to support these
types of operations with a combined member and non-member rule.

I *think* the right solution may be to continue to keep the rules separate,
but add an extra check to the nonmember-moderation rule, such that if any of
the senders are members, then the rule cannot hit, i.e. the sender is
definitely not a non-member.  A quick look at Aurélien's patch seems about
the right way to do it.  I'll hold off on reviewing and merging it though, to
get any additional feedback you might have.

Cheers,
-Barry


More information about the Mailman-Developers mailing list