From 00e2ef1c318e00cbf0f862ed839f6c7e44b1c0a9 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Sun, 2 Jan 2011 17:09:11 -0500 Subject: Split member and nonmember moderation. * member-moderation happens at the same place in the built-in chain that the previously named moderation rule happens. nonmember-moderation happens after all the other normal moderation rules. * Handle unsubscribed nonmember posts. Other changes: * Message.senders now filters out Nones and empty strings. * Various test cleanups and simplifications. * More `address` -> `email` fixes. * Give Link class a useful repr. * Fix a potential UnboundLocalError. * Various other small changes. --- src/mailman/queue/docs/incoming.txt | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 'src/mailman/queue/docs') diff --git a/src/mailman/queue/docs/incoming.txt b/src/mailman/queue/docs/incoming.txt index 75130c4cc..6455db20b 100644 --- a/src/mailman/queue/docs/incoming.txt +++ b/src/mailman/queue/docs/incoming.txt @@ -87,10 +87,12 @@ not linked to a user and are unverified. Accepted messages ================= -We have a message that is going to be sent to the mailing list. This message -is so perfectly fine for posting that it will be accepted and forward to the -pipeline queue. +We have a message that is going to be sent to the mailing list. Once Anne is +a member of the mailing list, this message is so perfectly fine for posting +that it will be accepted and forward to the pipeline queue. + >>> from mailman.testing.helpers import subscribe + >>> subscribe(mlist, 'Anne') >>> msg = message_from_string("""\ ... From: aperson@example.com ... To: test@example.com @@ -120,9 +122,9 @@ Now the message is in the pipeline queue. Subject: My first post Message-ID: Date: ... - X-Mailman-Rule-Misses: approved; emergency; loop; moderation; + X-Mailman-Rule-Misses: approved; emergency; loop; member-moderation; administrivia; implicit-dest; max-recipients; max-size; - news-moderation; no-subject; suspicious-header + news-moderation; no-subject; suspicious-header; nonmember-moderation First post! @@ -149,12 +151,12 @@ pipeline queue. ... event.msg['from'], event.msg['to'], ... event.msg['message-id']) - >>> import zope.event - >>> zope.event.subscribers.append(on_chain) - >>> mlist.emergency = True - >>> inject_message(mlist, msg) - >>> incoming.run() + + >>> from mailman.testing.helpers import event_subscribers + >>> with event_subscribers(on_chain): + ... inject_message(mlist, msg) + ... incoming.run() From: aperson@example.com @@ -187,8 +189,9 @@ new chain and set it as the mailing list's start chain. >>> mlist.start_chain = test_chain.name >>> msg.replace_header('message-id', '') - >>> inject_message(mlist, msg) - >>> incoming.run() + >>> with event_subscribers(on_chain): + ... inject_message(mlist, msg) + ... incoming.run() From: aperson@example.com @@ -216,8 +219,9 @@ just create a new chain that does. >>> mlist.start_chain = test_chain.name >>> msg.replace_header('message-id', '') - >>> inject_message(mlist, msg) - >>> incoming.run() + >>> with event_subscribers(on_chain): + ... inject_message(mlist, msg) + ... incoming.run() From: aperson@example.com @@ -257,8 +261,3 @@ to the original sender. --===============... >>> del config.chains['always-reject'] - -.. - Clean up. - - >>> zope.event.subscribers.remove(on_chain) -- cgit v1.3.1