]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Bug #1430298: It is now possible to send a mail with an empty
authorGeorg Brandl <georg@python.org>
Fri, 17 Feb 2006 09:53:00 +0000 (09:53 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 17 Feb 2006 09:53:00 +0000 (09:53 +0000)
return address using smtplib.

Lib/smtplib.py
Misc/NEWS

index 2e124838850f0bac1979257343540bbf4c3a8012..01ef53f0007bc8e50ba23a69b9d3de9188203702 100755 (executable)
@@ -175,8 +175,11 @@ def quoteaddr(addr):
     except AttributeError:
         pass
     if m == (None, None): # Indicates parse failure or AttributeError
-        #something weird here.. punt -ddm
+        # something weird here.. punt -ddm
         return "<%s>" % addr
+    elif m is None:
+        # the sender wants an empty return address
+        return "<>"
     else:
         return "<%s>" % m
 
index af3c3ad0e08b5f3143b091238580a9c499d5bec7..4d14c9a5ac7c5e219a9b971c6539255ee0c78073 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -74,6 +74,9 @@ Extension Modules
 Library
 -------
 
+- Bug #1430298: It is now possible to send a mail with an empty
+  return address using smtplib.
+
 - Bug #1432260: The names of lambda functions are now properly displayed 
   in pydoc.