[issue35805] email package folds msg-id identifiers using RFC2047 encoded words where it must not

2020-08-06 Thread Olivier Dony


Olivier Dony  added the comment:

Somehow the message identifiers in the code sample got messed up in previous 
comment, here's the actual code, for what it's worth ;-) 
https://gist.github.com/odony/0323eab303dad2077c1277076ecc3733

--

___
Python tracker 
<https://bugs.python.org/issue35805>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35805] email package folds msg-id identifiers using RFC2047 encoded words where it must not

2020-08-06 Thread Olivier Dony


Olivier Dony  added the comment:

Further, under Python 3.8 the issue is not fully solved, as other 
identification headers are still being folded in a non-RFC-conformant manner 
(see OP for RFC references). This was indicated on the original PR by the 
author: https://github.com/python/cpython/pull/13397#issuecomment-493618544

It is less severe of a problem than for Message-ID, but still means that 
MTA/MUA may fail to recognize the threading structure because identifiers are 
lost.

Is it better to open a new issue for this?


# Example on 3.8.2: the `In-Reply-To` header is RFC2047-folded.

Python 3.8.2 (default, Jul 16 2020, 14:00:26) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import email.message
>>> import email.policy
>>> msg = email.message.EmailMessage(policy=email.policy.SMTP)
>>> msg['Message-Id'] = 
>>> '<929227342217024.1596730490.324691772460938-example-30661-some.refere...@test-123.example.com>'
>>> msg['In-Reply-To'] = 
>>> '<92922734221723.1596730568.324691772460444-another-30661-parent.refere...@test-123.example.com>'
>>> print(msg.as_string())
Message-Id: 
<929227342217024.1596730490.324691772460938-example-30661-some.refere...@test-123.example.com>
In-Reply-To: =?utf-8?q?=3C92922734221723=2E1596730568=2E324691772460444-anot?=
 =?utf-8?q?her-30661-parent=2Ereference=40test-123=2Eexample=2Ecom=3E?=

--

___
Python tracker 
<https://bugs.python.org/issue35805>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35805] email package folds msg-id identifiers using RFC2047 encoded words where it must not

2020-08-06 Thread Olivier Dony


Olivier Dony  added the comment:

With regard to msg349895, is there any chance this fix could be considered for 
backport?

I imagine you could view it as a new feature, but it seems to be the only 
official fix we have for the fact that Python 3 generates invalid SMTP 
messages. And that's not a minor problem because many popular MTAs (GMail, 
Outlook, etc.) will rewrite non-RFC-conformant Message IDs, causing the 
original ID to be lost and missing in subsequent replies. This breaks an 
important mechanism to support email threads.

To this day, several Linux distributions still ship 3.6 or 3.7, even in their 
latest LTS, and users and vendors are stuck with supporting those for a while.

Thanks!

--
nosy: +odo2

___
Python tracker 
<https://bugs.python.org/issue35805>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com