[issue42498] smtplib is glitchy after receive server code 500

izomiac report at bugs.python.org
Tue Jan 5 14:01:17 EST 2021


izomiac <izomiac at zrwb3.r-66y.com> added the comment:

I agree, it's my suspicion that the server's error message and python's outbound command are sent so close to each other that buffering ensures they disagree about the exact sequence of commands/responses.

As for my server, it was HAProxy doing the injection and I rewrote the server to both ignore PROXY commands and to listen on multiple ports so a proxy is not necessary. 

So this issue no longer exists for me, but I know that I'm not the only one who uses HAProxy to forward SMTP requests (residential ISPs block port 25), and Python was relatively unique in its intolerance of this behavior.  (Python uses lower case commands, which are easy to recognize on server logs to determine which clients are using it.)  It's certainly not a critical issue affecting thousands, but in my experience glitchy behavior is a good indicator that the code is buggy in general.  Plus, buffering errors scare me because there are so many potential security exploits associated with them (on top of being a pain to debug.)  But, yeah, this is more of a courtesy bug to let you know about a tricky glitch I encountered.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42498>
_______________________________________


More information about the Python-bugs-list mailing list