From 31fc369a3fa0853bc71e4282d3863a7750a8ad7f Mon Sep 17 00:00:00 2001 From: msapiro <> Date: Tue, 4 Apr 2006 23:23:17 +0000 Subject: Recognize more bounces - DSN.py, Qmail.py and SimpleMatch.py --- Mailman/Bouncers/DSN.py | 9 ++++++++- Mailman/Bouncers/Qmail.py | 3 ++- Mailman/Bouncers/SimpleMatch.py | 12 ++++++++++-- 3 files changed, 20 insertions(+), 4 deletions(-) (limited to 'Mailman/Bouncers') diff --git a/Mailman/Bouncers/DSN.py b/Mailman/Bouncers/DSN.py index c6e17479..869e0461 100644 --- a/Mailman/Bouncers/DSN.py +++ b/Mailman/Bouncers/DSN.py @@ -71,6 +71,13 @@ def check(msg): # Note that params should already be unquoted. addrs.extend(params) break + else: + # MAS: This is a kludge, but SMTP-GATEWAY01.intra.home.dk + # has a final-recipient with an angle-addr and no + # address-type parameter at all. Non-compliant, but ... + for param in params: + if param.startswith('<') and param.endswith('>'): + addrs.append(param[1:-1]) # Uniquify rtnaddrs = {} for a in addrs: @@ -89,6 +96,6 @@ def process(msg): # 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. - if not msg.is_multipart() or msg.get_subtype() <> 'report': + if not msg.is_multipart() or msg.get_content_subtype() <> 'report': return None return check(msg) diff --git a/Mailman/Bouncers/Qmail.py b/Mailman/Bouncers/Qmail.py index 2a2f8cd6..def4abfa 100644 --- a/Mailman/Bouncers/Qmail.py +++ b/Mailman/Bouncers/Qmail.py @@ -32,7 +32,8 @@ import email.Iterators # Other (non-standard?) intros have been observed in the wild. introtags = [ 'Hi. This is the', - "We're sorry. There's a problem" + "We're sorry. There's a problem", + 'Check your send e-mail address.' ] acre = re.compile(r'<(?P[^>]*)>:') diff --git a/Mailman/Bouncers/SimpleMatch.py b/Mailman/Bouncers/SimpleMatch.py index 232b8b7a..12eeffdc 100644 --- a/Mailman/Bouncers/SimpleMatch.py +++ b/Mailman/Bouncers/SimpleMatch.py @@ -89,11 +89,11 @@ PATTERNS = [ _c('<(?P[^>]*)>:')), # kundenserver.de (_c('A message that you sent could not be delivered'), - _c('^--- The header of the original'), + _c('^---'), _c('<(?P[^>]*)>')), # another kundenserver.de (_c('A message that you sent could not be delivered'), - _c('^--- The header of the original'), + _c('^---'), _c('^(?P[^\s@]+@[^\s@:]+):')), # thehartford.com (_c('Delivery to the following recipients failed'), @@ -119,6 +119,14 @@ PATTERNS = [ (_c('^Invalid final delivery userid:'), _c('^Original message follows.'), _c('\s*(?P[^\s@]+@[^\s@]+)\s*$')), + # E500_SMTP_Mail_Service@lerctr.org + (_c('------ Failed Recipients ------'), + _c('-------- Returned Mail --------'), + _c('<(?P[^>]*)>')), + # cynergycom.net + (_c('A message that you sent could not be delivered'), + _c('^---'), + _c('(?P[^\s@]+@[^\s@)]+)')), # Next one goes here... ] -- cgit v1.2.3