Fix: Enforce CRLF when writing an email message to the file (#14745)

This commit is contained in:
Trenton H authored and GitHub committed 2026-11-12 00:18:43 +00:00
1 parent f5ca9bbcb6
commit a1d76f3a19
1 file changed
+7 -1
+7 -1
View File
@@ -1159,7 +1159,13 @@ class MailAccountHandler(LoggingMixin):
new_headers += message.obj._headers
message.obj._headers = new_headers
f.write(message.obj.as_bytes())
# RFC 5322 requires CRLF; the default compat32 policy writes bare LF,
# which Outlook misreads as literal "=" in quoted-printable soft breaks
f.write(
message.obj.as_bytes(
policy=message.obj.policy.clone(linesep="\r\n"),
),
)
correspondent = self._get_correspondent(message, rule)