Title: smtpd should return greeting
Type: enhancement Stage: resolved
Components: email Versions: Python 3.7
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: Håkan Lövdahl, barry, jcea, lpolzer, mike.a, r.david.murray
Priority: normal Keywords:

Created on 2012-11-12 15:08 by mike.a, last changed 2018-01-10 00:49 by barry. This issue is now closed.

Messages (9)
msg175451 - (view) Author: (mike.a) Date: 2012-11-12 15:08
The greeting value is required by SPF, and should be returned by SMTPChannel. This would involve a simple fix by adding self.__greeting to the list of returned values in the status object
msg175452 - (view) Author: Jesús Cea Avión (jcea) * (Python committer) Date: 2012-11-12 15:24
Mike, could you possibly elaborate more?. I don't understand your bug report.

BTW, Python 2.6 is open only for security bugfixes. Python 2.7, 3.2 and 3.3 are currently open for regular bugfixes.
msg175454 - (view) Author: (mike.a) Date: 2012-11-12 15:36
The greeting value is the HELO/EHLO identity. RFC 4408 (SPF) recommends checking both the mail from domain as well as the HELO identity, so this value is useful and could be passed to proc_message() function (API for "doing something useful with this message"). Later versions of the code pass the same values, so this is relevant for 2.7, 3.2, and 3.3.
msg175457 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-11-12 15:50
Are you asking to have seen_greeting passed in the server.process_message call?  That is reasonable.
msg175458 - (view) Author: (mike.a) Date: 2012-11-12 15:53

Yes, that is what I am asking.

msg175460 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-11-12 16:06
On the other hand, it would also be backward incompatible.

Can anyone think of a backward compatible way to provide this info?  Maybe we could use the new signature object support.
msg176432 - (view) Author: Jesús Cea Avión (jcea) * (Python committer) Date: 2012-11-26 17:35
The trivial approach would be to add a new "set_helo_string()" method to "SMTPServer" class, and be called before "process_message()". User subclasses would be inherit it.
msg275130 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-09-08 19:55
If someone wants to write a patch for this, we now require (unless you set decode_data to False) that process_message take a **kw dict, so we can pass the greeting in that dict.
msg309745 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2018-01-10 00:49
I'm closing this as won't fix since is deprecated and likely won't see any fixes.  Please take a look at aiosmtpd as a much better third party replacement.
Date User Action Args
2018-01-10 00:49:01barrysetstatus: open -> closed
resolution: wont fix
messages: + msg309745

stage: resolved
2016-09-08 19:55:14r.david.murraysetmessages: + msg275130
versions: + Python 3.7, - Python 3.4
2015-03-07 15:17:05Håkan Lövdahlsetnosy: + Håkan Lövdahl
2013-11-20 10:54:06lpolzersetnosy: + lpolzer
2012-11-26 17:35:48jceasetmessages: + msg176432
2012-11-12 16:06:11r.david.murraysetversions: + Python 3.4, - Python 2.6
2012-11-12 16:06:02r.david.murraysetmessages: + msg175460
2012-11-12 15:53:58mike.asetmessages: + msg175458
2012-11-12 15:50:18r.david.murraysetversions: + Python 2.6, - Python 3.1, Python 2.7, Python 3.2, Python 3.3
nosy: + barry, r.david.murray

messages: + msg175457

components: + email
2012-11-12 15:36:51mike.asetmessages: + msg175454
versions: + Python 3.1, Python 2.7, Python 3.2, Python 3.3, - Python 2.6
2012-11-12 15:24:23jceasetnosy: + jcea
messages: + msg175452
2012-11-12 15:08:11mike.acreate