summaryrefslogtreecommitdiff
path: root/src/mailman/pipeline/docs/ack-headers.rst
diff options
context:
space:
mode:
authorBarry Warsaw2011-09-23 21:42:39 -0400
committerBarry Warsaw2011-09-23 21:42:39 -0400
commit48354a7e6814190455fb566947ab952062ecde76 (patch)
tree874a9afe0c5ca798a83daa8c6462da6ecaecb2bf /src/mailman/pipeline/docs/ack-headers.rst
parent87966acc80cf4dabfb7f9d3019f62483376e2037 (diff)
downloadmailman-48354a7e6814190455fb566947ab952062ecde76.tar.gz
mailman-48354a7e6814190455fb566947ab952062ecde76.tar.zst
mailman-48354a7e6814190455fb566947ab952062ecde76.zip
Finally, all doctests are named .rst
Diffstat (limited to 'src/mailman/pipeline/docs/ack-headers.rst')
-rw-r--r--src/mailman/pipeline/docs/ack-headers.rst43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/mailman/pipeline/docs/ack-headers.rst b/src/mailman/pipeline/docs/ack-headers.rst
new file mode 100644
index 000000000..dba2169e2
--- /dev/null
+++ b/src/mailman/pipeline/docs/ack-headers.rst
@@ -0,0 +1,43 @@
+======================
+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.
+
+ >>> 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.
+::
+
+ >>> msg = message_from_string("""\
+ ... From: aperson@example.com
+ ...
+ ... A message of great import.
+ ... """)
+
+ >>> from mailman.pipeline.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
+ ...