[issue4142] smtplib doesn't clear helo/ehlo flags on quit

Felix Schwarz report at bugs.python.org
Sun Feb 15 16:18:55 CET 2009


Felix Schwarz <felix.schwarz at web.de> added the comment:

I can confirm that this issue is still present in Python 2.5.2, 2.6.1
and 3.0.1.

The current behavior of smtplib is a clear violation of the SMTP
specification. The problem can be reproduced with code like that (stub,
pseudo code-like):
smtp = smtplib.SMTP()
smtp.sendmail('from at example.com', 'foo at example.com', msg)
smtp.quit()
smtp.connect()
# This command does not send EHLO/HELO again, violating the spec!
smtp.sendmail('from at example.com', 'foo at example.com', msg)

Real world bug reports due to this behavior were mostly visible with
Exim because this MTA rejects the 'MAIL FROM' if SMTP extension verbs
are used without EHLO:
*
http://groups.google.com/group/turbomail-devel/browse_thread/thread/a25c89a94b42724f
* http://www.google.com/search?q=exim+python+%22malformed+address%22+size

----------
nosy: +Felix Schwarz

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4142>
_______________________________________


More information about the Python-bugs-list mailing list