[issue35788] smtpd.PureProxy and smtpd.MailmanProxy broken by extra kwargs, bytes and more

2019-01-21 Thread Samuel Colvin


Samuel Colvin  added the comment:

Great, https://bugs.python.org/issue35799 and 
https://bugs.python.org/issue35800 created.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35788] smtpd.PureProxy and smtpd.MailmanProxy broken by extra kwargs, bytes and more

2019-01-21 Thread R. David Murray


R. David Murray  added the comment:

Actually, thinking about it some more, you are right.  If PureProxy doesn't at 
least function according to the current docs it should either be fixed or we 
should deprecate-and-remove it in 3.8 or 3.9 (depending on how strongly people 
feel about the deprecation cycle), and we should remove MailmanProxy.  Feel 
free to open new, targeted issues for these.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35788] smtpd.PureProxy and smtpd.MailmanProxy broken by extra kwargs, bytes and more

2019-01-21 Thread Samuel Colvin


Samuel Colvin  added the comment:

Ok. Thanks for your explanation. Makes sense.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35788] smtpd.PureProxy and smtpd.MailmanProxy broken by extra kwargs, bytes and more

2019-01-21 Thread R. David Murray


R. David Murray  added the comment:

The mailman proxy has been abandoned for a long time now, so no fixes there.  I 
have some sympathy to fixing PureProxy, but since the stdlib itself doesn't use 
it, not a lot :)

At some point we will start cleaning up old code (probably a while after 2.7 is 
dead) after going through a release-deprecation-cycle, but that time hasn't 
arrived yet.  smtpd itself will stay because the stdlib test suite uses it, but 
you are right that MailmanProxy can be removed, as well as PrueProxy if we 
don't fix it.

We are not in general going to fix bugs in it that don't impact the stdlib 
itself, but if Barry (or someone else) wants to review and accept the PureProxy 
PR that's fine with me.  I don't myself have time to review it, I'm afraid.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35788] smtpd.PureProxy and smtpd.MailmanProxy broken by extra kwargs, bytes and more

2019-01-21 Thread Samuel Colvin


Samuel Colvin  added the comment:

Thanks for the response.

I've created issues on aiosmtpd for both these things. There are much better 
ways of running the controller than threading, but that's a discussion for 
https://github.com/aio-libs/aiosmtpd/issues/160. I'll try and work on aiosmtpd 
in the future.

Regarding smtpd, please could you respond to:

> More generally I understand the idea of deprecated code that doesn't get 
> updated to conform to latest conventions, but surely if the code exists in 
> the standard lib. it should at least work as it was originally intended or be 
> removed?

Of course, I know part of this is my wish to get my PR merged into cpython, but 
I really don't see any argument for leaving completely broken code in the 
standard library.

Surely either it should be removed before the next minor release or fixed?

I would say PureProxy could still be useful and should be left in place while 
MailmanProxy should be removed.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35788] smtpd.PureProxy and smtpd.MailmanProxy broken by extra kwargs, bytes and more

2019-01-21 Thread R. David Murray


R. David Murray  added the comment:

It is documented as deprecated, but only in the 'seealso' note at the top.  I 
think it would be reasonable to open an issue to add an actual 'deprecated' 
ReST tag to the docs.

For your 1 and 2, the stdlib smtpd forwarding is also blocking; that code 
appears to be copied verbatim from stdlib smtpd.  It needs to be replaced with 
calls to aiosmtplib.  Feel free to submit a PR :)

For your 3, that design is so that you can run the smtpd server as part of a 
non-asyncio application (eg: for testing, which has always been the main 
purpose of this module).  For an asyncio-only application you would not use a 
Controller (unless you wanted to offload the smtp traffic to a different 
thread, of course, then it would be useful :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35788] smtpd.PureProxy and smtpd.MailmanProxy broken by extra kwargs, bytes and more

2019-01-20 Thread Samuel Colvin


Samuel Colvin  added the comment:

Thanks for the explanation David.

It would be really useful if this was prominently noted in smtpd, it would have 
saved me spending my morning fixing these things. There's also (AFAIK) nothing 
about this being deprecated in the docs.

More generally I understand the idea of deprecated code that doesn't get 
updated to conform to latest conventions, but surely if the code exists in the 
standard lib. it should at least work as it was originally intended or be 
removed?

Since the PR is done and passing surely it would be better to merge it than 
leave PureProxy completely broken.

By the way, aiosmtpd is not in good shape:
1. Its proxy handler is blocking 
https://github.com/aio-libs/aiosmtpd/blob/master/aiosmtpd/handlers.py#L119
2. Its proxy handler appears to be broken in some other way, I couldn't get it 
to forward emails which is why I resorted to using standard smtpd.
3. It's built in a very odd way, it appears to use threading not asyncio to run 
the main controller 
https://github.com/aio-libs/aiosmtpd/blob/master/aiosmtpd/controller.py#L54

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35788] smtpd.PureProxy and smtpd.MailmanProxy broken by extra kwargs, bytes and more

2019-01-20 Thread R. David Murray


R. David Murray  added the comment:

Thanks for being willing to work on this, but smtpd is deprecated in favor of 
aiosmtpd (which is not part of the stdlib).  smtpd should really only be used 
for internal stdlib testing, but it is retained for backward compatibility 
reasons.

All of these issues have been previously reported and were closed in favor of 
recommending aiosmtpd because we are no longer maintaining smtpd.

--
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed
type: crash -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35788] smtpd.PureProxy and smtpd.MailmanProxy broken by extra kwargs, bytes and more

2019-01-20 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

> Should I create a new issue(s) for these problems or is there some agreement 
> that only actual bugs will be fixed in little-used modules like this?

I would create new issue for each point to discuss, but I would like listen 
other opinions

--
nosy: +eamanu

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35788] smtpd.PureProxy and smtpd.MailmanProxy broken by extra kwargs, bytes and more

2019-01-20 Thread Samuel Colvin


Change by Samuel Colvin :


--
keywords: +patch, patch, patch
pull_requests: +11381, 11382, 11383
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35788] smtpd.PureProxy and smtpd.MailmanProxy broken by extra kwargs, bytes and more

2019-01-20 Thread Samuel Colvin


Change by Samuel Colvin :


--
keywords: +patch, patch
pull_requests: +11381, 11382
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35788] smtpd.PureProxy and smtpd.MailmanProxy broken by extra kwargs, bytes and more

2019-01-20 Thread Samuel Colvin


Change by Samuel Colvin :


--
keywords: +patch, patch, patch, patch
pull_requests: +11381, 11382, 11383, 11384
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35788] smtpd.PureProxy and smtpd.MailmanProxy broken by extra kwargs, bytes and more

2019-01-20 Thread Samuel Colvin


Change by Samuel Colvin :


--
keywords: +patch
pull_requests: +11381
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35788] smtpd.PureProxy and smtpd.MailmanProxy broken by extra kwargs, bytes and more

2019-01-20 Thread Samuel Colvin


New submission from Samuel Colvin :

smtpd.PureProxy.process_message and smtpd.MailmanProxy.process_message are 
defined to not receive the extra kwargs which they're called with.

They both also expect "data" to be str when it's actually bytes.

Thus they're completed broken at the moment.

I'd like to submit a PR to fix these two bugs.

There are a number of other issues/potential improvements to smtpd which are 
not critical but I guess should be fixed:
* no support for starttls
* use of print(..., file=DEBUGSTREAM) instead of logger.debug
* no type hints
* PureProxy's forwarding doesn't try starttls

Should I create a new issue(s) for these problems or is there some agreement 
that only actual bugs will be fixed in little-used modules like this?

--
components: email
messages: 334083
nosy: barry, r.david.murray, samuelcolvin
priority: normal
severity: normal
status: open
title: smtpd.PureProxy and smtpd.MailmanProxy broken by extra kwargs, bytes and 
more
type: crash
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com