From 6cd54b29ce171114c8ab927f29a3c8b9a26c5dc2 Mon Sep 17 00:00:00 2001 From: msapiro <> Date: Fri, 24 Mar 2006 18:13:53 +0000 Subject: Added bounce tests. Updated bounce recognizers to pick up a few more. --- Mailman/Bouncers/DSN.py | 4 ++++ Mailman/Bouncers/SimpleMatch.py | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'Mailman/Bouncers') 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[^\s@]+@[^\s@]+)\s*$')), # and another thehartfod.com/hartfordlife.com - (_c('^Your message'), + (_c('^Your message\s*$'), _c('^because:'), _c('^\s*(?P[^\s@]+@[^\s@]+)\s*$')), + # kviv.be (NTMail) + (_c('^Unable to deliver message to'), + _c(r'\*+\s+End of message\s+\*+'), + _c('<(?P[^>]*)>')), + # earthlink.net supported domains + (_c('^Sorry, unable to deliver your message to'), + _c('^A copy of the original message'), + _c('\s*(?P[^\s@]+@[^\s@]+)\s+')), + # ademe.fr + (_c('^A message could not be delivered to:'), + _c('^Subject:'), + _c('^\s*(?P[^\s@]+@[^\s@]+)\s*$')), + # andrew.ac.jp + (_c('^Invalid final delivery userid:'), + _c('^Original message follows.'), + _c('\s*(?P[^\s@]+@[^\s@]+)\s*$')), # Next one goes here... ] -- cgit v1.2.3