[issue7484] smtplib: verify breaks with Postfix servers

R. David Murray report at bugs.python.org
Wed Apr 13 03:59:48 CEST 2011


R. David Murray <rdmurray at bitdance.com> added the comment:

Thanks for working on this.

The tests seem to be missing, as is the line that adds 'clean' to the def, so the patches won't work as is.

However, now that I've looked at the patch in more detail, adding a parameter to a public method is not something we can do in a bug fix release.  So, this solution would work for 3.3, but not for 2.7 and 3.2.  In any case, Guido thinks that parameters that have only two values should be replaced by methods with two different names.  In this case that makes a lot of sense.  I've checked the RFC and the code, and there are two cases: MAIL FROM and RCPT TO, which require the address to be in <>s, and VRFY and EXPN, which prefer that it not be in <>s.  So I think we should introduce a new, private function for use in the VRFY and EXPN cases:

    def _addronly(addr):
        (fullname, email) = email.utils.parseaddr(addr)
        return email

Can you do a new patch, adding the above function and using it at the right places?  Tests are also needed...it should be possible to modify the test that the original patch modified so that it checks to make sure the <> are not added.  If you need help with that let me know.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7484>
_______________________________________


More information about the Python-bugs-list mailing list