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 PureProxy breaks on mail_options keyword argument
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: closed Resolution: duplicate
Dependencies: Superseder: fix or remove smtpd.PureProxy
View: 35799
Assigned To: Nosy List: Sjoerder, barry, giampaolo.rodola, r.david.murray, samuelcolvin, xtreak
Priority: normal Keywords: patch, patch

Created on 2019-01-27 12:56 by Sjoerder, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 11685 closed python-dev, 2019-01-27 13:23
PR 11685 closed python-dev, 2019-01-27 13:23
Messages (5)
msg334424 - (view) Author: Sjoerd (Sjoerder) Date: 2019-01-27 12:56
According to https://python.readthedocs.io/en/stable/whatsnew/3.5.html:

The SMTPServer class now advertises the 8BITMIME extension (RFC 6152) if decode_data has been set True. If the client specifies BODY=8BITMIME on the MAIL command, it is passed to SMTPServer.process_message() via the mail_options keyword. (Contributed by Milan Oberkirch and R. David Murray in bpo-21795.)

This means that process_message gets a mail_options kwarg. However, the smtpd PureProxy and MailmanProxy don't take keyword arguments, which results in an exception.

One way to trigger this is to run a debug mailserver and send a mail to it:

$ python3 -m smtpd -n
error: uncaptured python exception, closing channel <__main__.SMTPChannel connected ('::1', 52007, 0, 0) at 0x10e7eddd8> (<class 'TypeError'>:process_message() got an unexpected keyword argument 'mail_options' [/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncore.py|read|83] [/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncore.py|handle_read_event|422] [/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asynchat.py|handle_read|171] [/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/smtpd.py|found_terminator|386])
msg334428 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-01-27 14:45
Thanks for the report. smtpd is deprecated in favor of aiosmtpd. Some of the fixes were closed in the past as won't fix. Please see https://bugs.python.org/issue35788#msg334088 and the discussion for deprecation and removal.
msg334431 - (view) Author: Samuel Colvin (samuelcolvin) * Date: 2019-01-27 16:54
Hi, did you see https://bugs.python.org/issue35788#msg334155 later in the issue?
msg334432 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-01-27 17:00
Sorry, I overlooked that one. While searching for other smtpd issues many of them were closed as won't fix and hence my message. Thanks for the link.
msg334531 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2019-01-29 16:58
I'm closing this in favor of #35799 because someone has to first make a remove-or-fix decision, which is mentioned there.
History
Date User Action Args
2022-04-11 14:59:10adminsetgithub: 80018
2019-01-29 16:58:28r.david.murraysetstatus: open -> closed

superseder: fix or remove smtpd.PureProxy
keywords: patch, patch
messages: + msg334531
type: behavior
resolution: duplicate
stage: patch review -> resolved
2019-01-27 17:00:12xtreaksetkeywords: patch, patch

messages: + msg334432
2019-01-27 16:54:58samuelcolvinsetmessages: + msg334431
2019-01-27 16:53:47Sjoerdersetnosy: + samuelcolvin
2019-01-27 14:45:22xtreaksetkeywords: patch, patch
nosy: + barry, xtreak
messages: + msg334428

2019-01-27 13:23:43python-devsetkeywords: + patch
stage: patch review
pull_requests: + pull_request11527
2019-01-27 13:23:37python-devsetkeywords: + patch
stage: (no value)
pull_requests: + pull_request11526
2019-01-27 12:56:37Sjoerdercreate