summaryrefslogtreecommitdiff
path: root/mailman/rules/docs/loop.txt
diff options
context:
space:
mode:
authorBarry Warsaw2009-01-25 13:01:41 -0500
committerBarry Warsaw2009-01-25 13:01:41 -0500
commiteefd06f1b88b8ecbb23a9013cd223b72ca85c20d (patch)
tree72c947fe16fce0e07e996ee74020b26585d7e846 /mailman/rules/docs/loop.txt
parent07871212f74498abd56bef3919bf3e029eb8b930 (diff)
downloadmailman-eefd06f1b88b8ecbb23a9013cd223b72ca85c20d.tar.gz
mailman-eefd06f1b88b8ecbb23a9013cd223b72ca85c20d.tar.zst
mailman-eefd06f1b88b8ecbb23a9013cd223b72ca85c20d.zip
Diffstat (limited to 'mailman/rules/docs/loop.txt')
-rw-r--r--mailman/rules/docs/loop.txt48
1 files changed, 0 insertions, 48 deletions
diff --git a/mailman/rules/docs/loop.txt b/mailman/rules/docs/loop.txt
deleted file mode 100644
index 61612cd75..000000000
--- a/mailman/rules/docs/loop.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-Posting loops
-=============
-
-To avoid a posting loop, Mailman has a rule to check for the existence of an
-X-BeenThere header with the value of the list's posting address.
-
- >>> mlist = config.db.list_manager.create(u'_xtest@example.com')
- >>> rule = config.rules['loop']
- >>> print rule.name
- loop
-
-The header could be missing, in which case the rule does not match.
-
- >>> msg = message_from_string("""\
- ... From: aperson@example.com
- ...
- ... An important message.
- ... """)
- >>> rule.check(mlist, msg, {})
- False
-
-The header could be present, but not match the list's posting address.
-
- >>> msg['X-BeenThere'] = u'not-this-list@example.com'
- >>> rule.check(mlist, msg, {})
- False
-
-If the header is present and does match the posting address, the rule
-matches.
-
- >>> del msg['x-beenthere']
- >>> msg['X-BeenThere'] = mlist.posting_address
- >>> rule.check(mlist, msg, {})
- True
-
-Even if there are multiple X-BeenThere headers, as long as one with the
-posting address exists, the rule matches.
-
- >>> msg = message_from_string("""\
- ... From: aperson@example.com
- ... X-BeenThere: not-this-list@example.com
- ... X-BeenThere: _xtest@example.com
- ... X-BeenThere: foo@example.com
- ...
- ... An important message.
- ... """)
- >>> rule.check(mlist, msg, {})
- True