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

smtpd.py (SMTPChannel): implement enhanced status codes #63878

Closed
lpolzer mannequin opened this issue Nov 21, 2013 · 8 comments
Closed

smtpd.py (SMTPChannel): implement enhanced status codes #63878

lpolzer mannequin opened this issue Nov 21, 2013 · 8 comments
Labels
stdlib Python modules in the Lib dir topic-email type-feature A feature request or enhancement

Comments

@lpolzer
Copy link
Mannequin

lpolzer mannequin commented Nov 21, 2013

BPO 19679
Nosy @warsaw, @bitdancer

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2018-01-10.00:57:15.087>
created_at = <Date 2013-11-21.10:59:58.962>
labels = ['type-feature', 'library', 'expert-email']
title = 'smtpd.py (SMTPChannel): implement enhanced status codes'
updated_at = <Date 2018-01-10.00:57:15.086>
user = 'https://bugs.python.org/lpolzer'

bugs.python.org fields:

activity = <Date 2018-01-10.00:57:15.086>
actor = 'barry'
assignee = 'none'
closed = True
closed_date = <Date 2018-01-10.00:57:15.087>
closer = 'barry'
components = ['Library (Lib)', 'email']
creation = <Date 2013-11-21.10:59:58.962>
creator = 'lpolzer'
dependencies = []
files = []
hgrepos = []
issue_num = 19679
keywords = []
message_count = 8.0
messages = ['203610', '203622', '204361', '204371', '204384', '204396', '204514', '309757']
nosy_count = 3.0
nosy_names = ['barry', 'r.david.murray', 'lpolzer']
pr_nums = []
priority = 'normal'
resolution = 'wont fix'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue19679'
versions = ['Python 3.5']

@lpolzer
Copy link
Mannequin Author

lpolzer mannequin commented Nov 21, 2013

ESMTP status messages (of the form "xab x.y.z test") can be added easily to the current status message strings emitted by the SMTP server and channel classes. They are not harmful if the user's server only intends to support plain HELO-SMTP

I will provide a patch within due time unless someone disagrees.

@lpolzer lpolzer mannequin added stdlib Python modules in the Lib dir topic-email type-feature A feature request or enhancement labels Nov 21, 2013
@lpolzer
Copy link
Mannequin Author

lpolzer mannequin commented Nov 21, 2013

The contents of "conn" are already stored by asyncore's "socket" attribute, so there doesn't seem to be a need to keep it around. We should deprecate its usage and refer the user to the "socket" attribute.

Furthermore I suggest renaming the "conn" argument to "socket" to make its semantics clearer.

@lpolzer lpolzer mannequin changed the title smtpd.py: implement ESMTP status messages smtpd.py (SMTPChannel): get rid of "conn" attribute Nov 21, 2013
@bitdancer
Copy link
Member

Are you referring to implementing rfc 3463 and rfc 5248 insofar as they are applicable? That seems useful. I don't see anything in the RFC about the 'xab x.y.z text' form of the message, though. Where is that documented? IMO these messages should only be emitted if we got an ELHO...actually I would expect there to be an extension keyword associated with this, but I don't see one in the RFC.

The conn argument is a separate issue. (And probably should not change for backward compatibility reasons. Also, it doesn't have to be a socket, although it would indeed be unusual if it wasn't.)

@lpolzer
Copy link
Mannequin Author

lpolzer mannequin commented Nov 25, 2013

Sorry for the confusion, the second comment (#msg203622) should actually have been a separate ticket.

Since you'd like to preserve "conn" I will just change the title of this ticket.

@lpolzer lpolzer mannequin changed the title smtpd.py (SMTPChannel): get rid of "conn" attribute smtpd.py (SMTPChannel): implement enhanced status codes Nov 25, 2013
@lpolzer
Copy link
Mannequin Author

lpolzer mannequin commented Nov 25, 2013

I am indeed referring to the enhanced status codes proposed in RFC 3463. This would just entail adding information to the status codes, converting them from the format "<simple status code> <human-readable string>" to "<simple status code> <enhanced status code> <human-readable string>".

In this it doesn't seem necessary to differentiate by HELO/EHLO; neither is it demanded by the standard nor does it result in an incompatible form of traditional HELO status messages. HELO clients should just interpret the first three digits and regard the rest as part of the human readable informal section.

@bitdancer
Copy link
Member

"Should" and "do" are different, though. I wouldn't be at all surprised to find legacy code that did look at the text string part of the message. Particularly test code, which is a place that smtpd gets used commonly.

Which probably means that what we really need is a keyword argument to the SMTPServer constructor (analogous to data_size_limit) that indicates whether or not enhanced status codes are enabled, and have it be off by default. If desired, we could then issue a warning that enhanced status codes will be enabled by default in 3.6. That kind of process is our usual backward-compatibility dance. In this particular instance we could go one step farther and add a deprecation warning in 3.6 that the ability to set enhanced status codes off will go away in 3.7. If anybody remembers to carry through on it :)

@lpolzer
Copy link
Mannequin Author

lpolzer mannequin commented Nov 26, 2013

Sounds reasonable, I will propose a patch soon. Thanks!

@warsaw
Copy link
Member

warsaw commented Jan 10, 2018

I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement.

@warsaw warsaw closed this as completed Jan 10, 2018
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir topic-email type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants