Skip to content

Mail line length too long, breaks DKIM signature #24528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
delgor opened this issue Sep 9, 2019 · 3 comments
Closed

Mail line length too long, breaks DKIM signature #24528

delgor opened this issue Sep 9, 2019 · 3 comments
Assignees
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@delgor
Copy link

delgor commented Sep 9, 2019

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 (*)

  1. Magento CE 2.3.2
  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 (*)

  1. 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".
screenshot-mail-tester-valid-signature

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"
screenshot-mail-tester-invalid-signature

@m2-assistant
Copy link

m2-assistant bot commented Sep 9, 2019

Hi @delgor. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@delgor do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Sep 9, 2019
@ghost ghost assigned delgor Sep 9, 2019
@gwharton
Copy link
Contributor

Already fixed in 2.3-develop. Scheduled for 2.3.3 release

@gwharton
Copy link
Contributor

See PR #23649

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests

3 participants