diff options
| -rw-r--r-- | Mailman/Bouncers/Microsoft.py | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/Mailman/Bouncers/Microsoft.py b/Mailman/Bouncers/Microsoft.py index 76f226ad1..d8ddb876a 100644 --- a/Mailman/Bouncers/Microsoft.py +++ b/Mailman/Bouncers/Microsoft.py @@ -31,31 +31,34 @@ def process(msg): return None boundary = msg.getparam('boundary') msg.fp.seek(0) - mfile = multifile.MultiFile(msg.fp) - mfile.push(boundary) - # find the first subpart, which has no mime type + addrs = [] try: - more = mfile.next() + mfile = multifile.MultiFile(msg.fp) + mfile.push(boundary) + # find the first subpart, which has no mime type + try: + more = mfile.next() + except multifile.Error: + # the message *looked* like a DSN, but it really wasn't :( + return None + if not more: + # we didn't find it + return None + # simple state machine + # 0 == nothng seen yet + # 1 == tag line seen + state = 0 + while 1: + line = mfile.readline() + if not line: + break + line = string.strip(line) + if state == 0: + if scre.search(line): + state = 1 + if state == 1: + if '@' in line: + addrs.append(line) except multifile.Error: - # the message *looked* like a DSN, but it really wasn't :( - return None - if not more: - # we didn't find it - return None - addrs = [] - # simple state machine - # 0 == nothng seen yet - # 1 == tag line seen - state = 0 - while 1: - line = mfile.readline() - if not line: - break - line = string.strip(line) - if state == 0: - if scre.search(line): - state = 1 - if state == 1: - if '@' in line: - addrs.append(line) - return addrs or [] + pass + return addrs |
