From bd3bc4dc4c18cd1b3f1ce0dd2065bbed6de4f267 Mon Sep 17 00:00:00 2001
From: Georg Brandl <georg@python.org>
Date: Fri, 17 Feb 2006 09:52:53 +0000
Subject: Bug #1430298: It is now possible to send a mail with an empty return
 address using smtplib.

---
 Lib/smtplib.py | 5 ++++-
 Misc/NEWS      | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/Lib/smtplib.py b/Lib/smtplib.py
index 57605a9..71d25fd 100755
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -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
 
diff --git a/Misc/NEWS b/Misc/NEWS
index 9b5740b..bf61e77 100644
--- 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.
 
-- 
cgit v0.12

