[issue8739] Update to smtpd.py to RFC 5321
report at bugs.python.org
Tue Mar 13 04:26:27 CET 2012
Dan Boswell <fruitnuke at gmail.com> added the comment:
I built on Michele's patch during the pycon sprint, addressing some of the concerns rightly raised in previous comment:
1. Turn off the SIZE extension if client uses HELO (though limits are still used internally to limit message size for DoS protection), and report syntax of MAIL/RCPT correctly depending on whether HELO is issued.
2. Extend max command size by 26 chars when SIZE extension is enabled, as required by RFC 1870.
3. First cut at adding parameters to RCPT command for SMTP extensions as required by RFC 1869/5321.
4. Return 555 for MAIL/RCPT parameters that are valid but not implemented.
and some other issues:
1. Fix typo 'maximium' -> 'maximum'
2. Add test to show failure to parse localpart of email address (left as expected failure as a correct parse will require version 6 of the email package).
3. Fix up command line arg for specifying SIZE extension.
Still some issues to resolve, I already came up with a couple in testing, and some of the (new) code can be cleaned up.
So far this server implements the SIZE and 8BITMIME extensions in a
tightly-coupled manner, and does not make it easy for subclasses to implement additional smtp extensions. Ideally we would make SMTPChannel extensible in this way but that may require extensive refactoring and would be better raised and addressed as another issue.
Added file: http://bugs.python.org/file24812/issue8739.patch
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list