diff options
Diffstat (limited to 'Mailman/Bouncers/Qmail.py')
-rw-r--r-- | Mailman/Bouncers/Qmail.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/Mailman/Bouncers/Qmail.py b/Mailman/Bouncers/Qmail.py index f6019ce8..2a2f8cd6 100644 --- a/Mailman/Bouncers/Qmail.py +++ b/Mailman/Bouncers/Qmail.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2006 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -12,7 +12,8 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. """Parse bounce messages generated by qmail. @@ -28,7 +29,11 @@ This module should be conformant. import re import email.Iterators -introtag = 'Hi. This is the' +# Other (non-standard?) intros have been observed in the wild. +introtags = [ + 'Hi. This is the', + "We're sorry. There's a problem" + ] acre = re.compile(r'<(?P<addr>[^>]*)>:') @@ -42,8 +47,11 @@ def process(msg): state = 0 for line in email.Iterators.body_line_iterator(msg): line = line.strip() - if state == 0 and line.startswith(introtag): - state = 1 + if state == 0: + for introtag in introtags: + if line.startswith(introtag): + state = 1 + break elif state == 1 and not line: # Looking for the end of the intro paragraph state = 2 |