summaryrefslogtreecommitdiff
path: root/Mailman/docs/cleanse.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Mailman/docs/cleanse.txt')
-rw-r--r--Mailman/docs/cleanse.txt19
1 files changed, 7 insertions, 12 deletions
diff --git a/Mailman/docs/cleanse.txt b/Mailman/docs/cleanse.txt
index ce0a69b23..2e40e6df5 100644
--- a/Mailman/docs/cleanse.txt
+++ b/Mailman/docs/cleanse.txt
@@ -5,13 +5,9 @@ All messages posted to a list get their headers cleansed. Some headers are
related to additional permissions that can be granted to the message and other
headers can be used to fish for membership.
- >>> from email import message_from_string
- >>> from Mailman.Message import Message
>>> from Mailman.Handlers.Cleanse import process
>>> from Mailman.configuration import config
- >>> from Mailman.database import flush
- >>> mlist = config.db.list_manager.create('_xtest@example.com')
- >>> flush()
+ >>> mlist = config.db.list_manager.create(u'_xtest@example.com')
Headers such as Approved, Approve, and Urgent are used to grant special
pemissions to individual messages. All may contain a password; the first two
@@ -20,7 +16,7 @@ for approval. The latter header is used to send a regular message to all
members, regardless of whether they get digests or not. Because all three
headers contain passwords, they must be removed from any posted message.
- >>> msg = message_from_string("""\
+ >>> msg = message_from_string(u"""\
... From: aperson@example.com
... Approved: foobar
... Approve: barfoo
@@ -28,7 +24,7 @@ headers contain passwords, they must be removed from any posted message.
... Subject: A message of great import
...
... Blah blah blah
- ... """, Message)
+ ... """)
>>> process(mlist, msg, {})
>>> print msg.as_string()
From: aperson@example.com
@@ -43,7 +39,7 @@ headers supported by some mail readers. For example, X-PMRC is supported by
Pegasus mail. I don't remember what program uses X-Confirm-Reading-To though
(Some Microsoft product perhaps?).
- >>> msg = message_from_string("""\
+ >>> msg = message_from_string(u"""\
... From: bperson@example.com
... Reply-To: bperson@example.org
... Sender: asystem@example.net
@@ -54,7 +50,7 @@ Pegasus mail. I don't remember what program uses X-Confirm-Reading-To though
... Subject: a message to you
...
... How are you doing?
- ... """, Message)
+ ... """)
>>> process(mlist, msg, {})
>>> print msg.as_string()
From: bperson@example.com
@@ -80,8 +76,7 @@ Hotmail apparently sets X-Originating-Email.
>>> mlist.anonymous_list = True
>>> mlist.description = u'A Test Mailing List'
>>> mlist.preferred_language = u'en'
- >>> flush()
- >>> msg = message_from_string("""\
+ >>> msg = message_from_string(u"""\
... From: bperson@example.com
... Reply-To: bperson@example.org
... Sender: asystem@example.net
@@ -89,7 +84,7 @@ Hotmail apparently sets X-Originating-Email.
... Subject: a message to you
...
... How are you doing?
- ... """, Message)
+ ... """)
>>> process(mlist, msg, {})
>>> print msg.as_string()
Subject: a message to you