summaryrefslogtreecommitdiff
path: root/Mailman/pipeline/docs
diff options
context:
space:
mode:
Diffstat (limited to 'Mailman/pipeline/docs')
-rw-r--r--Mailman/pipeline/docs/acknowledge.txt16
-rw-r--r--Mailman/pipeline/docs/after-delivery.txt4
-rw-r--r--Mailman/pipeline/docs/archives.txt16
-rw-r--r--Mailman/pipeline/docs/avoid-duplicates.txt16
-rw-r--r--Mailman/pipeline/docs/calc-recips.txt8
-rw-r--r--Mailman/pipeline/docs/cleanse.txt8
-rw-r--r--Mailman/pipeline/docs/file-recips.txt10
-rw-r--r--Mailman/pipeline/docs/nntp.txt10
8 files changed, 45 insertions, 43 deletions
diff --git a/Mailman/pipeline/docs/acknowledge.txt b/Mailman/pipeline/docs/acknowledge.txt
index 615697e70..3dd92854f 100644
--- a/Mailman/pipeline/docs/acknowledge.txt
+++ b/Mailman/pipeline/docs/acknowledge.txt
@@ -5,7 +5,7 @@ When a user posts a message to a mailing list, and that user has chosen to
receive acknowledgments of their postings, Mailman will sent them such an
acknowledgment.
- >>> from Mailman.pipeline.acknowledge import process
+ >>> handler = config.handlers['acknowledge']
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
>>> mlist.real_name = u'XTest'
>>> mlist.preferred_language = u'en'
@@ -39,7 +39,7 @@ Non-members can't get acknowledgments of their posts to the mailing list.
... From: bperson@example.com
...
... """)
- >>> process(mlist, msg, {})
+ >>> handler.process(mlist, msg, {})
>>> virginq.files
[]
@@ -50,7 +50,8 @@ person is also not a member, no acknowledgment will be sent either.
... From: bperson@example.com
...
... """)
- >>> process(mlist, msg, dict(original_sender=u'cperson@example.com'))
+ >>> handler.process(mlist, msg,
+ ... dict(original_sender=u'cperson@example.com'))
>>> virginq.files
[]
@@ -64,7 +65,7 @@ Unless the user has requested acknowledgments, they will not get one.
... From: aperson@example.com
...
... """)
- >>> process(mlist, msg, {})
+ >>> handler.process(mlist, msg, {})
>>> virginq.files
[]
@@ -77,7 +78,8 @@ will be sent.
>>> address_2.subscribe(mlist, MemberRole.member)
<Member: dperson@example.com on _xtest@example.com as MemberRole.member>
- >>> process(mlist, msg, dict(original_sender=u'dperson@example.com'))
+ >>> handler.process(mlist, msg,
+ ... dict(original_sender=u'dperson@example.com'))
>>> virginq.files
[]
@@ -97,7 +99,7 @@ The receipt will include the original message's subject in the response body,
... Subject: Something witty and insightful
...
... """)
- >>> process(mlist, msg, {})
+ >>> handler.process(mlist, msg, {})
>>> len(virginq.files)
1
>>> qmsg, qdata = virginq.dequeue(virginq.files[0])
@@ -131,7 +133,7 @@ If there is no subject, then the receipt will use a generic message.
... From: aperson@example.com
...
... """)
- >>> process(mlist, msg, {})
+ >>> handler.process(mlist, msg, {})
>>> len(virginq.files)
1
>>> qmsg, qdata = virginq.dequeue(virginq.files[0])
diff --git a/Mailman/pipeline/docs/after-delivery.txt b/Mailman/pipeline/docs/after-delivery.txt
index fa4c6914d..138cc5bc4 100644
--- a/Mailman/pipeline/docs/after-delivery.txt
+++ b/Mailman/pipeline/docs/after-delivery.txt
@@ -6,8 +6,8 @@ by the rest of the handlers in the incoming queue pipeline, a couple of
bookkeeping pieces of information are updated.
>>> import datetime
- >>> from Mailman.pipeline.after_delivery import process
>>> from Mailman.configuration import config
+ >>> handler = config.handlers['after-delivery']
>>> 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
@@ -21,7 +21,7 @@ attributes.
...
... Something interesting.
... """)
- >>> process(mlist, msg, {})
+ >>> handler.process(mlist, msg, {})
>>> mlist.last_post_time > post_time
True
>>> mlist.post_id
diff --git a/Mailman/pipeline/docs/archives.txt b/Mailman/pipeline/docs/archives.txt
index f902ab59e..41fc49a00 100644
--- a/Mailman/pipeline/docs/archives.txt
+++ b/Mailman/pipeline/docs/archives.txt
@@ -7,9 +7,9 @@ delivery processes while messages are archived. This also allows external
archivers to work in a separate process from the main Mailman delivery
processes.
- >>> from Mailman.pipeline.to_archive import process
>>> from Mailman.queue import Switchboard
>>> from Mailman.configuration import config
+ >>> handler = config.handlers['to-archive']
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
>>> mlist.preferred_language = u'en'
>>> switchboard = Switchboard(config.ARCHQUEUE_DIR)
@@ -34,7 +34,7 @@ For example, no digests should ever get archived.
...
... A message of great import.
... """)
- >>> process(mlist, msg, dict(isdigest=True))
+ >>> handler.process(mlist, msg, dict(isdigest=True))
>>> switchboard.files
[]
@@ -42,7 +42,7 @@ If the mailing list is not configured to archive, then even regular deliveries
won't be archived.
>>> mlist.archive = False
- >>> process(mlist, msg, {})
+ >>> handler.process(mlist, msg, {})
>>> switchboard.files
[]
@@ -58,7 +58,7 @@ archived. Confusingly, this header's value is actually ignored.
...
... A message of great import.
... """)
- >>> process(mlist, msg, dict(isdigest=True))
+ >>> handler.process(mlist, msg, dict(isdigest=True))
>>> switchboard.files
[]
@@ -70,7 +70,7 @@ Even a 'no' value will stop the archiving of the message.
...
... A message of great import.
... """)
- >>> process(mlist, msg, dict(isdigest=True))
+ >>> handler.process(mlist, msg, dict(isdigest=True))
>>> switchboard.files
[]
@@ -83,7 +83,7 @@ header's case folded value must be 'no' in order to prevent archiving.
...
... A message of great import.
... """)
- >>> process(mlist, msg, dict(isdigest=True))
+ >>> handler.process(mlist, msg, dict(isdigest=True))
>>> switchboard.files
[]
@@ -95,7 +95,7 @@ But if the value is 'yes', then the message will be archived.
...
... A message of great import.
... """)
- >>> process(mlist, msg, {})
+ >>> handler.process(mlist, msg, {})
>>> len(switchboard.files)
1
>>> filebase = switchboard.files[0]
@@ -118,7 +118,7 @@ message will get archived.
...
... A message of great import.
... """)
- >>> process(mlist, msg, {})
+ >>> handler.process(mlist, msg, {})
>>> len(switchboard.files)
1
>>> filebase = switchboard.files[0]
diff --git a/Mailman/pipeline/docs/avoid-duplicates.txt b/Mailman/pipeline/docs/avoid-duplicates.txt
index 5e38eaae8..2050e6443 100644
--- a/Mailman/pipeline/docs/avoid-duplicates.txt
+++ b/Mailman/pipeline/docs/avoid-duplicates.txt
@@ -6,8 +6,8 @@ reduce the reception of duplicate messages. It does this by removing certain
recipients from the list of recipients that earlier handler modules
(e.g. CalcRecips) calculates.
- >>> from Mailman.pipeline.avoid_duplicates import process
>>> from Mailman.configuration import config
+ >>> handler = config.handlers['avoid-duplicates']
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
Create some members we're going to use.
@@ -36,7 +36,7 @@ The module short-circuits if there are no recipients.
... Something
... """)
>>> msgdata = {}
- >>> process(mlist, msg, msgdata)
+ >>> handler.process(mlist, msg, msgdata)
>>> msgdata
{}
>>> print msg.as_string()
@@ -63,7 +63,7 @@ will get a list copy.
... Something of great import.
... """)
>>> msgdata = recips.copy()
- >>> process(mlist, msg, msgdata)
+ >>> handler.process(mlist, msg, msgdata)
>>> sorted(msgdata['recips'])
[u'aperson@example.com', u'bperson@example.com']
>>> print msg.as_string()
@@ -81,7 +81,7 @@ If they're mentioned on the CC line, they won't get a list copy.
... Something of great import.
... """)
>>> msgdata = recips.copy()
- >>> process(mlist, msg, msgdata)
+ >>> handler.process(mlist, msg, msgdata)
>>> sorted(msgdata['recips'])
[u'bperson@example.com']
>>> print msg.as_string()
@@ -101,7 +101,7 @@ But if they're mentioned on the CC line and have receive_list_copy set to True
... Something of great import.
... """)
>>> msgdata = recips.copy()
- >>> process(mlist, msg, msgdata)
+ >>> handler.process(mlist, msg, msgdata)
>>> sorted(msgdata['recips'])
[u'aperson@example.com', u'bperson@example.com']
>>> print msg.as_string()
@@ -120,7 +120,7 @@ Other headers checked for recipients include the To...
... Something of great import.
... """)
>>> msgdata = recips.copy()
- >>> process(mlist, msg, msgdata)
+ >>> handler.process(mlist, msg, msgdata)
>>> sorted(msgdata['recips'])
[u'bperson@example.com']
>>> print msg.as_string()
@@ -139,7 +139,7 @@ Other headers checked for recipients include the To...
... Something of great import.
... """)
>>> msgdata = recips.copy()
- >>> process(mlist, msg, msgdata)
+ >>> handler.process(mlist, msg, msgdata)
>>> sorted(msgdata['recips'])
[u'bperson@example.com']
>>> print msg.as_string()
@@ -158,7 +158,7 @@ Other headers checked for recipients include the To...
... Something of great import.
... """)
>>> msgdata = recips.copy()
- >>> process(mlist, msg, msgdata)
+ >>> handler.process(mlist, msg, msgdata)
>>> sorted(msgdata['recips'])
[u'bperson@example.com']
>>> print msg.as_string()
diff --git a/Mailman/pipeline/docs/calc-recips.txt b/Mailman/pipeline/docs/calc-recips.txt
index f2a9b3113..193206a64 100644
--- a/Mailman/pipeline/docs/calc-recips.txt
+++ b/Mailman/pipeline/docs/calc-recips.txt
@@ -5,8 +5,8 @@ Every message that makes it through to the list membership gets sent to a set
of recipient addresses. These addresses are calculated by one of the handler
modules and depends on a host of factors.
- >>> from Mailman.pipeline.calculate_recipients import process
>>> from Mailman.configuration import config
+ >>> handler = config.handlers['calculate-recipients']
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
Recipients are calculate from the list members, so add a bunch of members to
@@ -52,7 +52,7 @@ but not all of the recipients.
... """)
>>> recips = set((u'qperson@example.com', u'zperson@example.com'))
>>> msgdata = dict(recips=recips)
- >>> process(mlist, msg, msgdata)
+ >>> handler.process(mlist, msg, msgdata)
>>> sorted(msgdata['recips'])
[u'qperson@example.com', u'zperson@example.com']
@@ -64,7 +64,7 @@ Regular delivery recipients are those people who get messages from the list as
soon as they are posted. In other words, these folks are not digest members.
>>> msgdata = {}
- >>> process(mlist, msg, msgdata)
+ >>> handler.process(mlist, msg, msgdata)
>>> sorted(msgdata['recips'])
[u'aperson@example.com', u'bperson@example.com', u'cperson@example.com']
@@ -77,7 +77,7 @@ Members can elect not to receive a list copy of their own postings.
... Something of great import.
... """)
>>> msgdata = {}
- >>> process(mlist, msg, msgdata)
+ >>> handler.process(mlist, msg, msgdata)
>>> sorted(msgdata['recips'])
[u'aperson@example.com', u'bperson@example.com']
diff --git a/Mailman/pipeline/docs/cleanse.txt b/Mailman/pipeline/docs/cleanse.txt
index 09cd49f08..698557120 100644
--- a/Mailman/pipeline/docs/cleanse.txt
+++ b/Mailman/pipeline/docs/cleanse.txt
@@ -5,8 +5,8 @@ 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 Mailman.pipeline.cleanse import process
>>> from Mailman.configuration import config
+ >>> handler = config.handlers['cleanse']
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
Headers such as Approved, Approve, and Urgent are used to grant special
@@ -25,7 +25,7 @@ headers contain passwords, they must be removed from any posted message.
...
... Blah blah blah
... """)
- >>> process(mlist, msg, {})
+ >>> handler.process(mlist, msg, {})
>>> print msg.as_string()
From: aperson@example.com
Subject: A message of great import
@@ -51,7 +51,7 @@ Pegasus mail. I don't remember what program uses X-Confirm-Reading-To though
...
... How are you doing?
... """)
- >>> process(mlist, msg, {})
+ >>> handler.process(mlist, msg, {})
>>> print msg.as_string()
From: bperson@example.com
Reply-To: bperson@example.org
@@ -85,7 +85,7 @@ Hotmail apparently sets X-Originating-Email.
...
... How are you doing?
... """)
- >>> process(mlist, msg, {})
+ >>> handler.process(mlist, msg, {})
>>> print msg.as_string()
Subject: a message to you
From: A Test Mailing List <_xtest@example.com>
diff --git a/Mailman/pipeline/docs/file-recips.txt b/Mailman/pipeline/docs/file-recips.txt
index a5824ce70..8b1ab8024 100644
--- a/Mailman/pipeline/docs/file-recips.txt
+++ b/Mailman/pipeline/docs/file-recips.txt
@@ -5,8 +5,8 @@ Mailman can calculate the recipients for a message from a Sendmail-style
include file. This file must be called members.txt and it must live in the
list's data directory.
- >>> from Mailman.pipeline.file_recipients import process
>>> from Mailman.configuration import config
+ >>> handler = config.handlers['file-recipients']
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
@@ -22,7 +22,7 @@ returns.
... A message.
... """)
>>> msgdata = {'recips': 7}
- >>> process(mlist, msg, msgdata)
+ >>> handler.process(mlist, msg, msgdata)
>>> print msg.as_string()
From: aperson@example.com
<BLANKLINE>
@@ -47,7 +47,7 @@ empty.
IOError: [Errno ...]
No such file or directory: u'.../_xtest@example.com/members.txt'
>>> msgdata = {}
- >>> process(mlist, msg, msgdata)
+ >>> handler.process(mlist, msg, msgdata)
>>> sorted(msgdata['recips'])
[]
@@ -70,7 +70,7 @@ addresses are returned as the set of recipients.
... fp.close()
>>> msgdata = {}
- >>> process(mlist, msg, msgdata)
+ >>> handler.process(mlist, msg, msgdata)
>>> sorted(msgdata['recips'])
['bperson@example.com', 'cperson@example.com', 'dperson@example.com',
'eperson@example.com', 'fperson@example.com', 'gperson@example.com']
@@ -91,7 +91,7 @@ in the recipients list.
... A message.
... """)
>>> msgdata = {}
- >>> process(mlist, msg, msgdata)
+ >>> handler.process(mlist, msg, msgdata)
>>> sorted(msgdata['recips'])
['bperson@example.com', 'dperson@example.com',
'eperson@example.com', 'fperson@example.com', 'gperson@example.com']
diff --git a/Mailman/pipeline/docs/nntp.txt b/Mailman/pipeline/docs/nntp.txt
index 0a8fe625d..eec95b7c2 100644
--- a/Mailman/pipeline/docs/nntp.txt
+++ b/Mailman/pipeline/docs/nntp.txt
@@ -5,9 +5,9 @@ Mailman has an NNTP gateway, whereby messages posted to the mailing list can
be forwarded onto an NNTP newsgroup. Typically this means Usenet, but since
NNTP is to Usenet as IP is to the web, it's more general than that.
- >>> from Mailman.pipeline.to_usenet import process
>>> from Mailman.queue import Switchboard
>>> from Mailman.configuration import config
+ >>> handler = config.handlers['to-usenet']
>>> mlist = config.db.list_manager.create(u'_xtest@example.com')
>>> mlist.preferred_language = u'en'
>>> switchboard = Switchboard(config.NEWSQUEUE_DIR)
@@ -26,7 +26,7 @@ the newsgroup. The feature could be disabled, as is the default.
...
... Something of great import.
... """)
- >>> process(mlist, msg, {})
+ >>> handler.process(mlist, msg, {})
>>> switchboard.files
[]
@@ -34,13 +34,13 @@ Even if enabled, messages that came from the newsgroup are never gated back to
the newsgroup.
>>> mlist.gateway_to_news = True
- >>> process(mlist, msg, {'fromusenet': True})
+ >>> handler.process(mlist, msg, {'fromusenet': True})
>>> switchboard.files
[]
Neither are digests ever gated to the newsgroup.
- >>> process(mlist, msg, {'isdigest': True})
+ >>> handler.process(mlist, msg, {'isdigest': True})
>>> switchboard.files
[]
@@ -50,7 +50,7 @@ messages are gated to.
>>> mlist.linked_newsgroup = u'comp.lang.thing'
>>> mlist.nntp_host = u'news.example.com'
- >>> process(mlist, msg, {})
+ >>> handler.process(mlist, msg, {})
>>> len(switchboard.files)
1
>>> filebase = switchboard.files[0]