summaryrefslogtreecommitdiff
path: root/src/mailman/pipeline/docs/after-delivery.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/pipeline/docs/after-delivery.txt')
-rw-r--r--src/mailman/pipeline/docs/after-delivery.txt27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mailman/pipeline/docs/after-delivery.txt b/src/mailman/pipeline/docs/after-delivery.txt
new file mode 100644
index 000000000..b910e89a6
--- /dev/null
+++ b/src/mailman/pipeline/docs/after-delivery.txt
@@ -0,0 +1,27 @@
+After delivery
+==============
+
+After a message is delivered, or more correctly, after it has been processed
+by the rest of the handlers in the incoming queue pipeline, a couple of
+bookkeeping pieces of information are updated.
+
+ >>> import datetime
+ >>> 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
+ >>> mlist.post_id = 10
+
+Processing a message with this handler updates the last_post_time and post_id
+attributes.
+
+ >>> msg = message_from_string("""\
+ ... From: aperson@example.com
+ ...
+ ... Something interesting.
+ ... """)
+ >>> handler.process(mlist, msg, {})
+ >>> mlist.last_post_time > post_time
+ True
+ >>> mlist.post_id
+ 11