Skip to content
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

Multipart emails with empty multiline text part break DKIM #424

Closed
GioPan04 opened this issue Oct 2, 2024 · 5 comments
Closed

Multipart emails with empty multiline text part break DKIM #424

GioPan04 opened this issue Oct 2, 2024 · 5 comments

Comments

@GioPan04
Copy link

GioPan04 commented Oct 2, 2024

This is a similar issue to #411, although much specific.
I've noticed that If a multipart email (text and html) is sent and the text part contains more than 5 empty lines (both \r\n and \n) the email won't get correctly signed.

  • This message contains 5 empty lines and gets correctly signed working.txt

  • This message contains 6 empty lines and is not correctly signed fail.txt

I've also noticed that if a message is not correctly signed one empty line gets removed from the text part (this maybe the reason for the failing DKIM).

  • This is the message downloaded from gmail (the receiving server) which was sent with 5 empty new lines: pass-gmail.txt

  • This is the message downloaded from gmail which was sent with 6 empty new lines: fail-gmail.txt

@andris9
Copy link
Member

andris9 commented Oct 2, 2024

Yes, the current DKIM signing implementation is buggy. I plan to replace it with https://github.com/postalsys/mailauth which has a better, more tested implementation

@GioPan04
Copy link
Author

GioPan04 commented Oct 3, 2024

Is there any ETA on this?

@andris9
Copy link
Member

andris9 commented Oct 28, 2024

Try v 3.10.0

@andris9 andris9 closed this as completed Oct 28, 2024
@GioPan04
Copy link
Author

GioPan04 commented Nov 14, 2024

I'm still experiencing this issue.
A line between the multiparts is deleted after the dkim is calculated, breaking the previous body hash altogether.

I'm using Zone-MTA 3.10.0

@GioPan04
Copy link
Author

I was able to isolate the issue.
It seems like that if I connect to TLS or STARTTLS the DKIM is incorrectly calculated. When I connect to the raw 25 port the DKIM is valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants