-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
E-Mails sent by Magento are generated with too long lines for HTML content, which leads to further problems during processing by an DKIM-enabled E-Mail stack.
The maximum line length for a mail is defined in http://www.rfc-editor.org/rfc/rfc5322.txt
2.1.1. Line Length Limits
There are two limits that this specification places on the number of
characters in a line. Each line of characters MUST be no more than
998 characters, and SHOULD be no more than 78 characters, excluding
the CRLF.The 998 character limit is due to limitations in many implementations
that send, receive, or store IMF messages which simply cannot handle
more than 998 characters on a line. Receiving implementations would
do well to handle an arbitrarily large number of characters in a line
for robustness sake. However, there are so many implementations that
(in compliance with the transport requirements of [RFC5321]) do not
accept messages containing more than 1000 characters including the CR
and LF per line, it is important for implementations not to create
such messages.
Preconditions (*)
- Magento CE 2.3.2
- A DKIM-enabled E-Mail setup. I've used sendmail-mta together with opendkim. Setup instructions can be found at http://www.opendkim.org/opendkim-README
Steps to reproduce (*)
- Send any E-Mail through Magento.
For testing I've used the newsletter registration and sent the mails towards mail-tester.com. But any mail-sending functionality (customer registration, forgotten password have been tested) gain the same results.
Expected result (*)
The recipient shall receive an valid, DKIM-signed e-mail. Please see the attached screenshot "screenshot-mail-tester-valid-signature.png". Relevant are the DKIM_VALID recognition by SpamAssassin and the line "Your DKIM signature is valid".
Actual result (*)
The message body gets repaired during transit due to the original line length violation, leading to an invalid DKIM signature (body hash mismatch) - just as if the message had been modified on its way.
Please see the attached screenshot "screenshot-mail-tester-invalid-signature.png"