summaryrefslogtreecommitdiff
path: root/Mailman/handlers/docs/after-delivery.txt
blob: 784a142ecd4960fe01ff8332bbf18f1dbea3fb1c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
    >>> from Mailman.handlers.after_delivery import process
    >>> from Mailman.configuration import config
    >>> 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.
    ... """)
    >>> process(mlist, msg, {})
    >>> mlist.last_post_time > post_time
    True
    >>> mlist.post_id
    11