[issue16005] smtplib.SMTP().sendmail() and rset()

R. David Murray report at bugs.python.org
Sun Sep 23 18:48:41 CEST 2012


R. David Murray added the comment:

I believe that Google is technically out of compliance with the SMTP spec here.  What they are doing is not unreasonable, since they don't have any reason to want to waste resources on talking to a server they think is spamming them.

Making this work in a more useful fashion may be considered an enhancement rather than a bug fix, since arguably it is Google, not smtplib, that appears to be violating the RFC.  On the other hand, the fix is simple enough, is unlikely to be harmful, and it can be argued that handling this error is the proper action for a robust smtp client in any case, so I think we can justify making it a bug fix.

The rset is correct in the general case, so the fix would be to wrap it in a try/except and treat SMTPServerDisconnected as not-an-error.

DDarko, would you have any interest in proposing a patch with tests?

----------

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


More information about the Python-bugs-list mailing list