R. David Murray <rdmur...@bitdance.com> added the comment:

OK, I've gone through Dan's update (thanks very much for the tests!).  I'm 
uploading a revised patch.  The major differences are:

I've refactored the parsing.  Now it is a three step process: peel off the 
extra keyword (FROM:, TO:) if there is one, then pull off the address, then 
parse the remainder as parameters, doing a best-effort parse (that is, ignore 
tokens that don't parse as parameters rather than failing the entire parse if 
one is bad).  This fixed a bug where a space between the : and the address 
would break command parsing.  When the RFC5322 parser from email6 lands, it 
will almost be a drop in replacement for _parseaddr.  (Oh, yeah, I took the 
opportunity to eliminate the last __ methods.  There's no reason for those 
parsing methods to be __ methods.)  I say almost because it will allow us to 
correctly implement the difference in the syntax of the address for VRFY verses 
MAIL and RCPT by using two different functions from that parser.

I've removed the 8BITMIME support.  It was not implemented correctly per its 
RFC, and the server as it exists does not, in fact, support receiving binary 
data (it decodes what it receives using the utf-8 codec...which means it will 
raise a decode error on binary data).  It would be possible to add 8BITMIME 
support, but since it is non trivial we'll leave that to another issue.

I reworked the extended command length support to facilitate adding additional 
extension support.  What I did may not be the most useful refactoring, though.  
I considered just making the limit "large enough", but decided to keep the 
current behavior since it allows smtpd to be used to test clients handling smtp 
servers that enforce the limits.  Given that, a nice future feature would be to 
make the max command length limit settable as well.

I renamed max_message_size back to data_size_limit in order to maintain 
backward compatibility.

I updated the general help output to reflect the HELO/EHLO state.  I don't know 
what typical servers do for that (since HELP can be issued before them), but I 
think I've seen it work that way on other servers.

I've added a few more tests.

Unless someone wants to add tests for the smtpd command line, I think this 
patch is done.  Reviews welcome.

----------

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

Reply via email to