[Mailman-Developers] Bug in 2.0b4

Barry A. Warsaw bwarsaw@beopen.com
Mon, 17 Jul 2000 18:01:35 -0400 (EDT)


>>>>> "CVR" == Chuq Von Rospach <chuqui@plaidworks.com> writes:

    CVR> There's a bug in the bounce processing in B4. I just upgraded
    CVR> my productio server (finally!) to mailman, and I'm getting
    CVR> these in the error log:

This can only happen if the bounce message has a bogus
Original-Recipient: or Final-Recipient: header.  If it's missing the
address type field, the split will fail.  In that case, I'm inclined
not to guess at what the MTA was trying to say, and to return None,
meaning we couldn't extract an address from the header.  Attached is a
patch, but it would still be great if you had a sample of the message
that broke this so I could add it to my test suite.

-Barry

-------------------- snip snip --------------------
Index: DSN.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Bouncers/DSN.py,v
retrieving revision 1.5
diff -u -r1.5 DSN.py
--- DSN.py	2000/06/08 03:44:38	1.5
+++ DSN.py	2000/07/17 21:59:54
@@ -25,7 +25,11 @@
 
 
 def parseaddr(val):
-    atype, addr = string.split(val, ';')
+    try:
+        atype, addr = string.split(val, ';')
+    except ValueError:
+        # Bogus format for Original-Recipient: or Final-Recipient: fields
+        return None
     if string.lower(string.strip(atype)) <> 'rfc822':
         return None
     addr = string.strip(addr)