summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mailman/bin/gate_news.py1
-rw-r--r--src/mailman/chains/builtin.py6
-rw-r--r--src/mailman/pipeline/docs/cook-headers.txt30
-rw-r--r--src/mailman/rules/docs/loop.txt18
-rw-r--r--src/mailman/rules/loop.py8
5 files changed, 17 insertions, 46 deletions
diff --git a/src/mailman/bin/gate_news.py b/src/mailman/bin/gate_news.py
index 6d9e95468..c10248c53 100644
--- a/src/mailman/bin/gate_news.py
+++ b/src/mailman/bin/gate_news.py
@@ -113,6 +113,7 @@ def poll_newsgroup(mlist, conn, first, last, glock):
value = header[:i].lower()
if i > 0 and value == 'to':
found_to = True
+ # FIXME 2010-02-16 barry use List-Post header.
if value <> 'x-beenthere':
continue
if header[i:] == ': %s' % mlist.posting_address:
diff --git a/src/mailman/chains/builtin.py b/src/mailman/chains/builtin.py
index 763314982..fc31085f3 100644
--- a/src/mailman/chains/builtin.py
+++ b/src/mailman/chains/builtin.py
@@ -62,10 +62,10 @@ class BuiltInChain:
('suspicious-header', LinkAction.defer, None),
# Now if any of the above hit, jump to the hold chain.
('any', LinkAction.jump, 'hold'),
- # Take a detour through the self header matching chain, which we'll
- # create later.
+ # Take a detour through the header matching chain, which we'll create
+ # later.
('truth', LinkAction.detour, 'header-match'),
- # Finally, the builtin chain selfs to acceptance.
+ # Finally, the builtin chain jumps to acceptance.
('truth', LinkAction.jump, 'accept'),
)
diff --git a/src/mailman/pipeline/docs/cook-headers.txt b/src/mailman/pipeline/docs/cook-headers.txt
index fcb66bdbf..5d078c342 100644
--- a/src/mailman/pipeline/docs/cook-headers.txt
+++ b/src/mailman/pipeline/docs/cook-headers.txt
@@ -45,36 +45,6 @@ But if there was no original sender, then the empty string will be saved.
<BLANKLINE>
-X-BeenThere header
-==================
-
-The X-BeenThere header is what Mailman uses to recognize messages that have
-already been processed by this mailing list. It's one small measure against
-mail loops.
-
- >>> msg = message_from_string("""\
- ... From: aperson@example.com
- ...
- ... A message of great import.
- ... """)
- >>> process(mlist, msg, {})
- >>> print msg['x-beenthere']
- _xtest@example.com
-
-Mailman appends X-BeenThere headers, so if there already is one in the
-original message, the posted message will contain two such headers.
-
- >>> msg = message_from_string("""\
- ... From: aperson@example.com
- ... X-BeenThere: another@example.com
- ...
- ... A message of great import.
- ... """)
- >>> process(mlist, msg, {})
- >>> sorted(msg.get_all('x-beenthere'))
- [u'_xtest@example.com', u'another@example.com']
-
-
Mailman version header
======================
diff --git a/src/mailman/rules/docs/loop.txt b/src/mailman/rules/docs/loop.txt
index bb6da364b..d6be10f8a 100644
--- a/src/mailman/rules/docs/loop.txt
+++ b/src/mailman/rules/docs/loop.txt
@@ -3,7 +3,7 @@ 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.
+RFC 2369 List-Post header with the value of the list's posting address.
>>> mlist = create_list('_xtest@example.com')
>>> rule = config.rules['loop']
@@ -22,26 +22,26 @@ The header could be missing, in which case the rule does not match.
The header could be present, but not match the list's posting address.
- >>> msg['X-BeenThere'] = 'not-this-list@example.com'
+ >>> msg['List-Post'] = '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
+ >>> del msg['list-post']
+ >>> msg['List-Post'] = 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.
+Even if there are multiple List-Post 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
+ ... List-Post: not-this-list@example.com
+ ... List-Post: _xtest@example.com
+ ... List-Post: foo@example.com
...
... An important message.
... """)
diff --git a/src/mailman/rules/loop.py b/src/mailman/rules/loop.py
index 6f1a5ff6f..49fdd6ea8 100644
--- a/src/mailman/rules/loop.py
+++ b/src/mailman/rules/loop.py
@@ -37,12 +37,12 @@ class Loop:
implements(IRule)
name = 'loop'
- description = _('Look for a posting loop, via the X-BeenThere header.')
+ description = _('Look for a posting loop.')
record = True
def check(self, mlist, msg, msgdata):
"""See `IRule`."""
# Has this message already been posted to this list?
- been_theres = [value.strip().lower()
- for value in msg.get_all('x-beenthere', [])]
- return mlist.posting_address in been_theres
+ list_posts = set(value.strip().lower()
+ for value in msg.get_all('list-post', []))
+ return mlist.posting_address in list_posts