summaryrefslogtreecommitdiff
path: root/src/mailman/pipeline/docs/ack-headers.txt
blob: ca41df03e2cf4c99c76aec5e7fc68a7fa4061660 (plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
Acknowledgment headers
======================

Messages that flow through the global pipeline get their headers 'cooked',
which basically means that their headers go through several mostly unrelated
transformations.  Some headers get added, others get changed.  Some of these
changes depend on mailing list settings and others depend on how the message
is getting sent through the system.  We'll take things one-by-one.

    >>> from mailman.pipeline.cook_headers import process
    >>> mlist = config.db.list_manager.create(u'_xtest@example.com')
    >>> mlist.subject_prefix = u''

When the message's metadata has a 'noack' key set, an 'X-Ack: no' header is
added.

    >>> msg = message_from_string("""\
    ... From: aperson@example.com
    ...
    ... A message of great import.
    ... """)
    >>> process(mlist, msg, dict(noack=True))
    >>> print msg.as_string()
    From: aperson@example.com
    X-Ack: no
    ...

Any existing X-Ack header in the original message is removed.

    >>> msg = message_from_string("""\
    ... X-Ack: yes
    ... From: aperson@example.com
    ...
    ... A message of great import.
    ... """)
    >>> process(mlist, msg, dict(noack=True))
    >>> print msg.as_string()
    From: aperson@example.com
    X-Ack: no
    ...