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

Duplicated HELO/EHLO #78

Closed
Varbin opened this issue Apr 30, 2017 · 7 comments
Closed

Duplicated HELO/EHLO #78

Varbin opened this issue Apr 30, 2017 · 7 comments

Comments

@Varbin
Copy link
Contributor

Varbin commented Apr 30, 2017

As already mentioned in source code (

# See issue #21783 for a discussion of this behavior.
, also in original smtpd's code) a second HELO/EHLO is rejected but the standart says it should be handled as a RSET command.

Is there any special reason to not allow duplicated HELO/EHLO? I think the best way is to do the same other SMTP servers do: Allowing a duplicated HELO/EHLO.
Another option is to have a configuration option.

@warsaw
Copy link
Contributor

warsaw commented May 1, 2017

Do you mean specifically RFC 5321, $4.1.4? I would agree that to be compliant with this section, we should treat a second HELO/EHLO as semantically equivalent to a RSET followed by the HELO/EHLO.

@Varbin
Copy link
Contributor Author

Varbin commented May 7, 2017

Yes, I do mean RFC 5321, $4.1.4.

@warsaw
Copy link
Contributor

warsaw commented May 9, 2017

@Varbin Thanks for the response. I'd like to fix this, but as we're up against the Pycon deadline, I'm going to milestone this to post 1.0.

@warsaw warsaw added this to the post-1.0 milestone May 9, 2017
@Varbin
Copy link
Contributor Author

Varbin commented May 10, 2017

I fully understand that. Also the duplicated HELO / EHLO should probably never be a problem - does even one SMTP client send two HELO / EHLO commands in one session?

@warsaw
Copy link
Contributor

warsaw commented May 11, 2017

@Varbin I wouldn't expect it from a non-buggy client.

@zvyn
Copy link

zvyn commented Jun 2, 2017

There is a patch for the stdlib implementation at http://bugs.python.org/issue21783, I might find some time to port it over later today.

In terms of relevance: Using HELO or EHLO to reset a session is permitted by the standard so I think we should support it.

I don't know about clients but I did use this when debugging SMTP servers manually before (test something, see what response you get, type EHLO and try something different). In that case it seems better to EHLO instead of RSET to explicitly start a new SMTP session while keeping the TCP connection.

@Varbin
Copy link
Contributor Author

Varbin commented Jun 2, 2017

A patch would be:

....

I just saw you made a pull request...

@warsaw warsaw modified the milestones: 1.1, later Jun 3, 2017
@warsaw warsaw closed this as completed in 4fc4e17 Jun 3, 2017
warsaw added a commit that referenced this issue Jun 3, 2017
* As per RFC 5321, §4.1.4, multiple ``HELO`` / ``EHLO`` commands in the same
  session are semantically equivalent to ``RSET``.  (Closes #78)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants