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.

classification
Title: MIMEMultipart enforces line endings also for binary subparts
Type: behavior Stage:
Components: email Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: barry, r.david.murray, sophonet
Priority: normal Keywords:

Created on 2021-12-22 16:36 by sophonet, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg409041 - (view) Author: Sophonet (sophonet) Date: 2021-12-22 16:36
For an activity with fastapi, I am preparing a Response object with the content of a email.mime.multipart MIMEMultipart object. Adhering to the standards (RFC), a MIMEMultipart response uses CRLF line endings (policy=HTTP). However, the binary attachment I am adding with MIMEApplication() and multipart.attach() in that case gets corrupted since all bytes corresponding to newlines (LF) are replaces with CRLF.

Am I doing something wrong or is this a bug that needs to be fixed?

What I would like to achieve is building a RFC-compliant MIMEMultipart payload in which the subparts do not get altered (in case of application/octet-stream).

Thanks, Sophonet
History
Date User Action Args
2022-04-11 14:59:53adminsetgithub: 90312
2021-12-22 16:36:56sophonetcreate