summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Mailman/docs/after-delivery.txt11
-rw-r--r--Mailman/docs/antispam.txt12
2 files changed, 9 insertions, 14 deletions
diff --git a/Mailman/docs/after-delivery.txt b/Mailman/docs/after-delivery.txt
index 4304891e2..f5cbfe0e7 100644
--- a/Mailman/docs/after-delivery.txt
+++ b/Mailman/docs/after-delivery.txt
@@ -6,27 +6,22 @@ by the rest of the handlers in the incoming queue pipeline, a couple of
bookkeeping pieces of information are updated.
>>> import datetime
- >>> from email import message_from_string
- >>> from Mailman.Message import Message
>>> from Mailman.Handlers.AfterDelivery import process
>>> from Mailman.configuration import config
- >>> from Mailman.database import flush
- >>> mlist = config.db.list_manager.create('_xtest@example.com')
+ >>> mlist = config.db.list_manager.create(u'_xtest@example.com')
>>> post_time = datetime.datetime.now() - datetime.timedelta(minutes=10)
>>> mlist.last_post_time = post_time
>>> mlist.post_id = 10
- >>> flush()
Processing a message with this handler updates the last_post_time and post_id
attributes.
- >>> msg = message_from_string("""\
+ >>> msg = message_from_string(u"""\
... From: aperson@example.com
...
... Something interesting.
- ... """, Message)
+ ... """)
>>> process(mlist, msg, {})
- >>> flush()
>>> mlist.last_post_time > post_time
True
>>> mlist.post_id
diff --git a/Mailman/docs/antispam.txt b/Mailman/docs/antispam.txt
index b6717c797..3ad5e982e 100644
--- a/Mailman/docs/antispam.txt
+++ b/Mailman/docs/antispam.txt
@@ -10,13 +10,9 @@ Still, Mailman does employ a small number of rather ham-handed anti-spam
measures.
>>> from Mailman.Handlers.SpamDetect import process
- >>> from Mailman.Message import Message
>>> from Mailman.queue import Switchboard
>>> from Mailman.configuration import config
- >>> from Mailman.database import flush
- >>> from email import message_from_string
- >>> mlist = config.db.list_manager.create('_xtest@example.com')
- >>> flush()
+ >>> mlist = config.db.list_manager.create(u'_xtest@example.com')
Short circuiting
@@ -28,7 +24,7 @@ If a message is pre-approved, this handler does nothing.
... From: aperson@example.com
...
... An important message.
- ... """, Message)
+ ... """)
>>> msgdata = {'approved': True}
>>> process(mlist, msg, msgdata)
>>> print msg.as_string()
@@ -49,6 +45,7 @@ regular expression. For example, if we wanted to block all message that come
from 'aperson' regardless of the domain, we'd do something like the following
in our mailman.cfg file:
+ >>> old_value = config.KNOWN_SPAMMERS[:]
>>> config.KNOWN_SPAMMERS.append(('from', 'aperson'))
Now if the same message is posted to the mailing list, and that message is not
@@ -68,6 +65,9 @@ spam.
>>> msgdata
{}
+ # Restore global state
+ config.KNOWN_SPAMMERS = old_value
+
Header filter rules
-------------------