"Fossies" - the Fresh Open Source Software Archive

Member "mailman-3.3.7/src/mailman/handlers/docs/ack-headers.rst" (10 Nov 2022, 1448 Bytes) of package /linux/misc/mailman-3.3.7.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

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.app.lifecycle import create_list >>> mlist = create_list('_xtest@example.com') >>> mlist.subject_prefix = ''

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

>>> from mailman.testing.helpers import (specialized_message_from_string
...   as message_from_string)   
>>> msg = message_from_string("""\
... From: aperson@example.com
...
... A message of great import.
... """)

>>> from mailman.handlers.cook_headers import process
>>> 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 ...