[Email-SIG] Some parsing/generation issues of email in Python 3

Stephen J. Turnbull turnbull at sk.tsukuba.ac.jp
Wed Jun 8 10:42:31 EDT 2016


Hans-Peter Jansen writes:
 > Dear audience,
 > 
 > when coming back to this list, I couldn't believe my eyes because
 > of the low volume level, but after rechecking with the archives, I
 > have to accept, it is that quiet here, a bit too quiet from my
 > POV. Hmm.

It's just that very few people (one or two) are working on the module
and in my experience it has been rock-solid compared to either Python
2.7 email or the package distributed with Mailman 2.1.  I doubt very
many people are using Python 3 email on high-volume mailstreams yet,
as the high-performance networking (eg, Twisted) and perhaps some
other libraries were late to be ported.

 > I was quite astonished to find out, that this procedure isn't
 > working that well anymore: the email module appears way more
 > sensible in the current state.  This is a bit disappointing, as
 > reading the docs conveys, that some effort was put into reliability
 > and robustness. Given the much improved unicode handling of Python
 > 3 itself and the ever improving experience in handling emails, this
 > is contrary to my expectations, I have to confess.

It's a complete rewrite from first principles.  It's more robust in
principle and more maintainable in practice, but faced with 100s of
millions of emails (aka "tsunami of sewage"), the robustness can't be
guaranteed.  I'm willing to bet it will converge to "robust in
practice" much faster than the previous design did.

 > Minutes after switching to the new code, I stumbled across a traceback in 
 > msg.get_all('to') from a header like this:
 > 
 > To: unlisted-recipients: ;,
 >         ""@pop.kundenserver.de (no To-header on input)
 > 
 > Hmm, not nice. http://bugs.python.org/issue27257

The header arguable fails to conform to RFC 5321, though it's
syntactically permissible in RFC 5322.  (See my comment on the issue.)

 > All these issues were harvested in less than halve an hour. What
 > really troubles me is the quietness around here in the light of
 > this experience. Doesn't people use Python (3) yet/anymore for
 > these kind of tasks?

Probably not.

 > Does somebody care?

email 5 for Python 3 is a complete rewrite from first principles.
Yes, somebody cared.

 > Am I missing something?

Patience and understanding of how opensource software development
works, perhaps.



More information about the Email-SIG mailing list