diff options
-rw-r--r-- | Mailman/Bouncers/DSN.py | 4 | ||||
-rw-r--r-- | Mailman/Bouncers/SimpleMatch.py | 18 | ||||
-rw-r--r-- | tests/test_bounces.py | 6 |
3 files changed, 27 insertions, 1 deletions
diff --git a/Mailman/Bouncers/DSN.py b/Mailman/Bouncers/DSN.py index d78a1f4f..c6e17479 100644 --- a/Mailman/Bouncers/DSN.py +++ b/Mailman/Bouncers/DSN.py @@ -82,6 +82,10 @@ def check(msg): def process(msg): + # A DSN has been seen wrapped with a "legal disclaimer" by an outgoing MTA + # in a multipart/mixed outer part. + if msg.is_multipart() and msg.get_content_subtype() == 'mixed': + msg = msg.get_payload()[0] # The report-type parameter should be "delivery-status", but it seems that # some DSN generating MTAs don't include this on the Content-Type: header, # so let's relax the test a bit. diff --git a/Mailman/Bouncers/SimpleMatch.py b/Mailman/Bouncers/SimpleMatch.py index c3749b4a..232b8b7a 100644 --- a/Mailman/Bouncers/SimpleMatch.py +++ b/Mailman/Bouncers/SimpleMatch.py @@ -100,9 +100,25 @@ PATTERNS = [ _c("Bogus - there actually isn't anything"), _c('^\s*(?P<addr>[^\s@]+@[^\s@]+)\s*$')), # and another thehartfod.com/hartfordlife.com - (_c('^Your message'), + (_c('^Your message\s*$'), _c('^because:'), _c('^\s*(?P<addr>[^\s@]+@[^\s@]+)\s*$')), + # kviv.be (NTMail) + (_c('^Unable to deliver message to'), + _c(r'\*+\s+End of message\s+\*+'), + _c('<(?P<addr>[^>]*)>')), + # earthlink.net supported domains + (_c('^Sorry, unable to deliver your message to'), + _c('^A copy of the original message'), + _c('\s*(?P<addr>[^\s@]+@[^\s@]+)\s+')), + # ademe.fr + (_c('^A message could not be delivered to:'), + _c('^Subject:'), + _c('^\s*(?P<addr>[^\s@]+@[^\s@]+)\s*$')), + # andrew.ac.jp + (_c('^Invalid final delivery userid:'), + _c('^Original message follows.'), + _c('\s*(?P<addr>[^\s@]+@[^\s@]+)\s*$')), # Next one goes here... ] diff --git a/tests/test_bounces.py b/tests/test_bounces.py index e0979508..c3e0dc9b 100644 --- a/tests/test_bounces.py +++ b/tests/test_bounces.py @@ -51,6 +51,11 @@ class BounceTest(unittest.TestCase): ('SimpleMatch', 'simple_09.txt', ['RobotMail@auto-walther.de']), ('SimpleMatch', 'simple_10.txt', ['sais@thehartford.com']), ('SimpleMatch', 'simple_11.txt', ['carlosr73@hartfordlife.com']), + ('SimpleMatch', 'simple_12.txt', ['charrogar@rhine1.andrew.ac.jp']), + ('SimpleMatch', 'simple_13.txt', ['dycusibreix@ademe.fr']), + ('SimpleMatch', 'simple_14.txt', ['dump@dachamp.com', + 'iqxwmmfauudpo@dachamp.com']), + ('SimpleMatch', 'simple_15.txt', ['isam@kviv.be']), # SimpleWarning ('SimpleWarning', 'simple_03.txt', Stop), # GroupWise @@ -77,6 +82,7 @@ class BounceTest(unittest.TestCase): ('DSN', 'dsn_10.txt', ['anne.person@dom.ain']), ('DSN', 'dsn_11.txt', ['joem@example.com']), ('DSN', 'dsn_12.txt', ['auaauqdgrdz@jtc-con.co.jp']), + ('DSN', 'dsn_13.txt', ['marcooherbst@cardinal.com']), # Microsoft Exchange ('Exchange', 'microsoft_01.txt', ['DJBENNETT@IKON.COM']), ('Exchange', 'microsoft_02.txt', ['MDMOORE@BALL.COM']), |