Message251736
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. |
|
Date |
User |
Action |
Args |
2015-09-28 00:28:15 | r.david.murray | set | recipients:
+ r.david.murray, barry, brett.cannon, rhettinger, terry.reedy, vstinner, eric.smith |
2015-09-28 00:28:14 | r.david.murray | set | messageid: <1443400094.57.0.00802293185928.issue25008@psf.upfronthosting.co.za> |
2015-09-28 00:28:14 | r.david.murray | link | issue25008 messages |
2015-09-28 00:28:13 | r.david.murray | create | |
|