Barry Warsaw pushed to branch master at mailman / Mailman

Commits:
b5c275ba by Aurélien Bompard at 2015-11-21T15:10:41Z
Reorder the default-posting-chain to avoid spam.

Fixes: #163

Adapt unit tests.

- - - - -
e9a522a4 by Barry Warsaw at 2015-11-21T15:11:18Z
Reorder the default posting chain.  Closes !60

The default posting chain has been modified so that the header-match
chain and nonmember-moderation rule are processed before "hold" rules
are processed.  This allows for better anti-spam defenses and rejecting
non-member posts instead of always holding them for moderator review.
Given by Aurélien Bompard.  (Closes #163)

- - - - -


5 changed files:

- src/mailman/chains/builtin.py
- src/mailman/chains/docs/moderation.rst
- src/mailman/core/docs/chains.rst
- src/mailman/docs/NEWS.rst
- src/mailman/runners/docs/incoming.rst


Changes:

=====================================
src/mailman/chains/builtin.py
=====================================
--- a/src/mailman/chains/builtin.py
+++ b/src/mailman/chains/builtin.py
@@ -48,6 +48,10 @@ class BuiltInChain:
         ('loop', LinkAction.jump, 'discard'),
         # Determine whether the member or nonmember has an action shortcut.
         ('member-moderation', LinkAction.jump, 'moderation'),
+        # Take a detour through the header matching chain.
+        ('truth', LinkAction.detour, 'header-match'),
+        # Check for nonmember moderation.
+        ('nonmember-moderation', LinkAction.jump, 'moderation'),
         # Do all of the following before deciding whether to hold the message.
         ('administrivia', LinkAction.defer, None),
         ('implicit-dest', LinkAction.defer, None),
@@ -58,11 +62,6 @@ class BuiltInChain:
         ('suspicious-header', LinkAction.defer, None),
         # Now if any of the above hit, jump to the hold chain.
         ('any', LinkAction.jump, 'hold'),
-        # Take a detour through the header matching chain, which we'll create
-        # later.
-        ('truth', LinkAction.detour, 'header-match'),
-        # Check for nonmember moderation.
-        ('nonmember-moderation', LinkAction.jump, 'moderation'),
         # Finally, the builtin chain jumps to acceptance.
         ('truth', LinkAction.jump, 'accept'),
         )


=====================================
src/mailman/chains/docs/moderation.rst
=====================================
--- a/src/mailman/chains/docs/moderation.rst
+++ b/src/mailman/chains/docs/moderation.rst
@@ -83,6 +83,7 @@ built-in chain.  No rules hit and so the message is accepted.
         emergency
         loop
         member-moderation
+        nonmember-moderation
         administrivia
         implicit-dest
         max-recipients
@@ -90,7 +91,6 @@ built-in chain.  No rules hit and so the message is accepted.
         news-moderation
         no-subject
         suspicious-header
-        nonmember-moderation
 
 However, when Anne's moderation action is set to `hold`, her post is held for
 moderator approval.
@@ -207,13 +207,6 @@ moderator approval.
         emergency
         loop
         member-moderation
-        administrivia
-        implicit-dest
-        max-recipients
-        max-size
-        news-moderation
-        no-subject
-        suspicious-header
 
     >>> nonmember = mlist.nonmembers.get_member('b...@example.com')
     >>> nonmember


=====================================
src/mailman/core/docs/chains.rst
=====================================
--- a/src/mailman/core/docs/chains.rst
+++ b/src/mailman/core/docs/chains.rst
@@ -269,8 +269,8 @@ This message will end up in the `pipeline` queue.
     Message-ID-Hash: 4CMWUN6BHVCMHMDAOSJZ2Q72G5M32MWB
     X-Message-ID-Hash: 4CMWUN6BHVCMHMDAOSJZ2Q72G5M32MWB
     X-Mailman-Rule-Misses: approved; emergency; loop; member-moderation;
-        administrivia; implicit-dest; max-recipients; max-size;
-        news-moderation; no-subject; suspicious-header; nonmember-moderation
+        nonmember-moderation; administrivia; implicit-dest; max-recipients;
+        max-size; news-moderation; no-subject; suspicious-header
     <BLANKLINE>
     An important message.
     <BLANKLINE>


=====================================
src/mailman/docs/NEWS.rst
=====================================
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -77,6 +77,11 @@ Message handling
    use a placeholder of the format `$<archiver-name>_url` to insert the
    permalink to the message in the named archiver, for any archiver enabled
    for the mailing list.  Given by Abhilash Raj.
+ * The default posting chain has been modified so that the header-match chain
+   and nonmember-moderation rule are processed before "hold" rules are
+   processed.  This allows for better anti-spam defenses and rejecting
+   non-member posts instead of always holding them for moderator review.
+   Given by Aurélien Bompard.  (Closes #163)
 
 REST
 ----


=====================================
src/mailman/runners/docs/incoming.rst
=====================================
--- a/src/mailman/runners/docs/incoming.rst
+++ b/src/mailman/runners/docs/incoming.rst
@@ -129,8 +129,8 @@ Now the message is in the pipeline queue.
     X-Message-ID-Hash: 4CMWUN6BHVCMHMDAOSJZ2Q72G5M32MWB
     Date: ...
     X-Mailman-Rule-Misses: approved; emergency; loop; member-moderation;
-        administrivia; implicit-dest; max-recipients; max-size;
-        news-moderation; no-subject; suspicious-header; nonmember-moderation
+        nonmember-moderation; administrivia; implicit-dest; max-recipients;
+        max-size; news-moderation; no-subject; suspicious-header
     <BLANKLINE>
     First post!
     <BLANKLINE>



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/9708493d1ad982895f4250c491a04a4f575310cf...e9a522a4a9266c8f044b29c2c3075bd29d90cfc5
_______________________________________________
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to