This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients BreamoreBoy, Illirgway, doerwalter, giampaolo.rodola, jesstess, petri.lehtinen, r.david.murray, zvyn
Date 2014-07-14.13:09:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1405343389.12.0.162457867268.issue19806@psf.upfronthosting.co.za>
In-reply-to
Content
As Milan said, the problem doesn't arise in 3.5 with decode_data=False, since there's no decoding.  His patch doesn't actually fix the bug for the decode_data=True case, though, since the bug is a *valid* utf-8 sequence getting split across tcp buffers.

To fix it, we would need to change the implementation of decode_data.  Instead of conditionally decoding in collect_data, we'd need to postpone decoding to found_terminator.  This would have the undesirable affect of changing what is in the received_lines attribute, which is why we didn't do it in the decode_data patch.  Using an incremental decoder won't solve that problem, since it too would change what gets stored in received_lines.

Since decode_data=True is really not a legitimate mode for smtpd (it is an historical accident/bug) and we are planning on removing it eventually, I think we should go ahead and apply Milan's patch as is, since it does improve the error reporting.  The message would need to be adjusted though, since it can trigger on valid utf-8 data.  It should say that smtpd should be run with decode_data=False in order to fix the decode problem.

That would leave the bug as-is in 3.4, but a similar patch with an error message suggesting an upgrade to 3.5/decode_data=True could be applied.  That feels a little weird, though :).
History
Date User Action Args
2014-07-14 13:09:49r.david.murraysetrecipients: + r.david.murray, doerwalter, giampaolo.rodola, jesstess, BreamoreBoy, petri.lehtinen, Illirgway, zvyn
2014-07-14 13:09:49r.david.murraysetmessageid: <1405343389.12.0.162457867268.issue19806@psf.upfronthosting.co.za>
2014-07-14 13:09:49r.david.murraylinkissue19806 messages
2014-07-14 13:09:48r.david.murraycreate