This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: smtplib: empty mail addresses
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, macfreek
Priority: normal Keywords:

Created on 2006-02-12 21:36 by macfreek, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg27500 - (view) Author: Freek Dijkstra (macfreek) Date: 2006-02-12 21:36
It is not possible to send an email with smtplib with an empty return 
address.

if you leave the sender mail address empty, smtplib will use "<None>" as 
sender, instead of "<>", as it should do. Note that an empty return 
address is typically used for mail delivery warnings (it has a valid usage!)

This bug is still in current SVN (I just checked http://svn.python.org/
projects/python/trunk/Lib/smtplib.py). Below is a fix for smtplib.py that 
came with Python 2.3 (since I still use that version). The bug is in the 
function "quoteaddr(addr):"

*** orig/smtplib.py   2005-05-14 23:48:03.000000000 +0200
--- smtplib.py  2006-02-08 09:52:25.000000000 +0100
***************
*** 176,181 ****
--- 176,183 ----
      if m == (None, None): # Indicates parse failure or AttributeError
          #something weird here.. punt -ddm
          return "<%s>" % addr
+     elif m == None:
+         return "<>"
      else:
          return "<%s>" % m
  
msg27501 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-02-17 09:53
Logged In: YES 
user_id=1188172

Thanks for the report, I applied your patch in rev. 42442,
42443 (2.4).
History
Date User Action Args
2022-04-11 14:56:15adminsetgithub: 42895
2006-02-12 21:36:24macfreekcreate