...
 
Commits (2)
......@@ -37,6 +37,8 @@ Bugs
(Closes #614)
* Encoded (base64 or quoted-printable) HTML message bodies are now decoded for
``html_to_plaintext``. (Closes #616)
* Non-VERPed temporary failure DSNs are no longer reported as unrecognized
bounces. (Closes #622)
Command line
------------
......
......@@ -19,7 +19,7 @@
import logging
from flufl.bounce import all_failures, scan_message
from flufl.bounce import all_failures
from mailman.app.bounces import ProbeVERP, StandardVERP, maybe_forward
from mailman.core.runner import Runner
from mailman.interfaces.bounce import BounceContext, IBounceProcessor
......@@ -64,11 +64,14 @@ class BounceRunner(Runner):
context = BounceContext.probe
else:
# That didn't give us anything useful, so try the old fashion
# bounce matching modules. This returns only the permanently
# failing addresses. Since Mailman currently doesn't score
# temporary failures, if we get no permanent failures, we're
# done.s
addresses = scan_message(msg)
# bounce matching modules. Since Mailman currently doesn't
# score temporary failures, if we get no permanent failures,
# we're done, but we do need to check for temporary failures
# to know if the bounce was recognized.
temporary, addresses = all_failures(msg)
if len(addresses) == 0 and len(temporary) > 0:
# This is a recognized temp fail so ignore it.
return False
# If that still didn't return us any useful addresses, then send it on
# or discard it. The addresses will come back from flufl.bounce as
# bytes/8-bit strings, but we must store them as unicodes in the
......
......@@ -169,7 +169,10 @@ Original-Recipient: rfc822; bart@example.com
def test_nonverp_detectable_nonfatal_bounce(self):
# Here's a bounce that is not VERPd, but which has a bouncing address
# that can be parsed from a known bounce format. The bounce is
# non-fatal so no bounce event is registered.
# non-fatal so no bounce event is registered and the bounce is not
# reported as unrecognized.
self._mlist.forward_unrecognized_bounces_to = (
UnrecognizedBounceDisposition.site_owner)
dsn = message_from_string("""\
From: mail-daemon@example.com
To: test-bounces@example.com
......@@ -186,10 +189,15 @@ Original-Recipient: rfc822; bart@example.com
--AAA--
""")
self._bounceq.enqueue(dsn, self._msgdata)
mark = LogFileMark('mailman.bounce')
self._runner.run()
get_queue_messages('bounces', expected_count=0)
events = list(self._processor.events)
self.assertEqual(len(events), 0)
# There should be nothing in the 'virgin' queue.
get_queue_messages('virgin', expected_count=0)
# There should be nothing logged.
self.assertEqual(len(mark.readline()), 0)
def test_no_detectable_bounce_addresses(self):
# A bounce message was received, but no addresses could be detected.
......