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: smtpd.py does not allow multiple helo/ehlo commands
Type: Stage: resolved
Components: email Versions: Python 3.5
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: barry, jesstess, pitrou, r.david.murray, zvyn
Priority: normal Keywords: patch

Created on 2014-06-16 20:27 by zvyn, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue21783.patch zvyn, 2015-06-13 04:31 review
Messages (6)
msg220754 - (view) Author: Milan Oberkirch (zvyn) * Date: 2014-06-16 20:27
Sending HELO or EHLO more then once causes smtpd.SMTPChannel to respond with b'503 Duplicate HELO/EHLO\r\n' (see Lib/test/test_smtpd.py:124 for an example).

My interpretation of RFC 821, section 4.1.1.5 is that multiple HELO commands are fine outside a mail transaction and a second HELO is eauivalent to a RSET during a mail transaction (undoing any changes made by previous greetings).

I would propose to reject greetings during mail transactiond (thats what RSET is for) and else accept them. The question is how we should handle backwards compatibility here.

I am willing to work on this right after #21725.
msg245290 - (view) Author: Milan Oberkirch (zvyn) * Date: 2015-06-13 04:31
Here is the patch how it should look like at some point. Question being: How should we handle backwards-compatibility?
msg294980 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2017-06-02 04:06
I don't have much interest in working on this for smtpd.py any more.  We have an asyncio-based version that's much better, albeit Python 3 only.

https://github.com/aio-libs/aiosmtpd

This same issue is open over there; if you're still interested in this, maybe take a look at contributing a fix for aiosmtpd.

https://github.com/aio-libs/aiosmtpd/issues/78
msg294991 - (view) Author: Milan Oberkirch (zvyn) * Date: 2017-06-02 09:04
Thanks for pointing me at this, Berry! I added a PR for aiosmtpd at https://github.com/aio-libs/aiosmtpd/pull/106
msg294992 - (view) Author: Milan Oberkirch (zvyn) * Date: 2017-06-02 09:05
*Barry :P
msg295103 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2017-06-03 20:18
This is now fixed in aiosmtpd HEAD (what will be 1.1)

I'm going to close this issue here even though smtpd.py isn't fixed since it's unlikely that anybody wants to keep working on smtpd.py.  Feel free to reopen it if you do.
History
Date User Action Args
2022-04-11 14:58:05adminsetgithub: 65982
2017-06-03 20:18:01barrysetstatus: open -> closed
resolution: wont fix
messages: + msg295103

stage: resolved
2017-06-02 09:05:28zvynsetmessages: + msg294992
2017-06-02 09:04:53zvynsetmessages: + msg294991
2017-06-02 04:06:56barrysetmessages: + msg294980
2015-06-13 04:31:17zvynsetfiles: + issue21783.patch
keywords: + patch
messages: + msg245290
2014-06-16 20:27:57zvyncreate