Bug #1430298: It is now possible to send a mail with an empty
authorGeorg Brandl <georg@python.org>
Fri, 17 Feb 2006 09:52:53 +0000 (09:52 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 17 Feb 2006 09:52:53 +0000 (09:52 +0000)
return address using smtplib.

Lib/smtplib.py
Misc/NEWS

index 57605a96dadc5b4757ac3f01c4c4f8a7dd7901b3..71d25fda268ecc8916171003895c1e7e76693aad 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 9b5740b53023264b98a5f40a184cbcdece9e7b6c..bf61e774a8584d2bd30f3bccb3448d990a55929b 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -363,6 +363,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.