R. David Murray added the comment:

Here is a proof of concept port of smtpd to asyncio.  Obviously I'm not 
suggesting we commit this patch (it isn't complete...the tests don't run).  
Instead I'm posting it as an outgrowth the of the sprint that was conducted 
today.  The DC team took a different tack, so I'm not submitting this as a 
patch to their repo, and since it is useful to look at the diff against 
default, it seems appropriate to post it here.

The advantage of this port is that it uses the existing smtpd protocol code, 
which is the "field tested" code.  Of course, I did have to change how the data 
is turned from bytes into lines, so I may have introduced some bugs.

As discussed, *using* an asyncio based smtpd has a different calling API than 
using the asynchat one.  However, the *pattern* is similar, so it may not be 
crazy to replace smtpd with the cleaned up version of this patch, exactly 
because the number of places this is used is relatively small and mostly in 
test code.  IMO it's a better option than deleting smtpd from the stdlib.

The code as is can be run using its CLI.  I tested it via telnet using the 
DebuggingServer and hand coding an email...for some reason I can't currently 
import smtplib (Enum errors in socket), so I didn't test it with smtplib, but 
it should work.

----------
keywords: +patch
Added file: http://bugs.python.org/file40605/aiosmtpd.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25008>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to