Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smtplib: empty mail addresses #42895

Closed
macfreek mannequin opened this issue Feb 12, 2006 · 2 comments
Closed

smtplib: empty mail addresses #42895

macfreek mannequin opened this issue Feb 12, 2006 · 2 comments
Labels
stdlib Python modules in the Lib dir

Comments

@macfreek
Copy link
Mannequin

macfreek mannequin commented Feb 12, 2006

BPO 1430298
Nosy @birkenfeld, @macfreek

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2006-02-17.09:53:19.000>
created_at = <Date 2006-02-12.21:36:24.000>
labels = ['library']
title = 'smtplib: empty mail addresses'
updated_at = <Date 2006-02-17.09:53:19.000>
user = 'https://github.com/macfreek'

bugs.python.org fields:

activity = <Date 2006-02-17.09:53:19.000>
actor = 'georg.brandl'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2006-02-12.21:36:24.000>
creator = 'macfreek'
dependencies = []
files = []
hgrepos = []
issue_num = 1430298
keywords = []
message_count = 2.0
messages = ['27500', '27501']
nosy_count = 2.0
nosy_names = ['georg.brandl', 'macfreek']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1430298'
versions = ['Python 2.3']

@macfreek
Copy link
Mannequin Author

macfreek mannequin commented Feb 12, 2006

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

@macfreek macfreek mannequin closed this as completed Feb 12, 2006
@macfreek macfreek mannequin added the stdlib Python modules in the Lib dir label Feb 12, 2006
@macfreek macfreek mannequin closed this as completed Feb 12, 2006
@macfreek macfreek mannequin added the stdlib Python modules in the Lib dir label Feb 12, 2006
@birkenfeld
Copy link
Member

Logged In: YES
user_id=1188172

Thanks for the report, I applied your patch in rev. 42442,
42443 (2.4).

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

1 participant