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

Bug: DKIM Failure for Emails with Content-Type: text/html #2165

Open
DNCD opened this issue Jul 28, 2024 · 5 comments
Open

Bug: DKIM Failure for Emails with Content-Type: text/html #2165

DNCD opened this issue Jul 28, 2024 · 5 comments

Comments

@DNCD
Copy link

DNCD commented Jul 28, 2024

Description:

Emails sent with Content-Type: text/html are failing DKIM checks, resulting in a "dkim=fail (body hash mismatch)" error. However, when emails are sent with Content-Type: text/plain, they pass DKIM checks without any issues.

Steps to Reproduce:

Send an email with `Content-Type: text/html`.
Check the DKIM status in the email headers.
Observe the "dkim=fail (body hash mismatch)" error.
Send an email with `Content-Type: text/plain`.
Check the DKIM status in the email headers.
Observe that the email passes DKIM checks.

Expected Behavior:

Emails sent with Content-Type: text/html should pass DKIM checks just like emails sent with Content-Type: text/plain.

Actual Behavior:

Emails with Content-Type: text/html fail DKIM checks with the error "dkim=fail (body hash mismatch)", whereas emails with Content-Type: text/plain pass DKIM checks.

@celogeek
Copy link

celogeek commented Jul 30, 2024

I've got similar issue. My mail go to spam most of the time (DMARC set to quarantine wrong DKIM). Probably due to encoding issue.
I fix the issue by stop using DKIM signature from SL directly.

I use OpenDkim or RSPAMD and let know SL to not doing it:

### ENV FILE
# DKIM_PRIVATE_KEY_PATH=/dkim.key
RSPAMD_SIGN_DKIM=true

It could be great to have that part working without the need of external tools. Or if it's not possible, then explain for self-hosting how to setup it using an external tools.

@DNCD
Copy link
Author

DNCD commented Jul 31, 2024

I've got similar issue. My mail go to spam most of the time (DMARC set to quarantine wrong DKIM). Probably due to encoding issue. I fix the issue by stop using DKIM signature from SL directly.

I use OpenDkim or RSPAMD and let know SL to not doing it:

### ENV FILE
# DKIM_PRIVATE_KEY_PATH=/dkim.key
RSPAMD_SIGN_DKIM=true

It could be great to have that part working without the need of external tools. Or if it's not possible, then explain for self-hosting how to setup it using an external tools.

Thanks for sharing your solution! It would be beneficial if this could work without relying on external tools. I will work on this this weekend. Thank You. I really appreciate it

@DNCD
Copy link
Author

DNCD commented Aug 8, 2024

I've got similar issue. My mail go to spam most of the time (DMARC set to quarantine wrong DKIM). Probably due to encoding issue.

I fix the issue by stop using DKIM signature from SL directly.

I use OpenDkim or RSPAMD and let know SL to not doing it:


### ENV FILE

# DKIM_PRIVATE_KEY_PATH=/dkim.key

RSPAMD_SIGN_DKIM=true

It could be great to have that part working without the need of external tools. Or if it's not possible, then explain for self-hosting how to setup it using an external tools.

@celogeek do you have any links to follow the installation? I set it up, but it's not signing outgoing emails for some reason.

@celogeek
Copy link

celogeek commented Aug 8, 2024

For 1 domain, this one is pretty ok: https://wiki.debian.org/opendkim
For multiple domain, then google is your friend.
I need to write a tutorial, will try soon.

@DNCD
Copy link
Author

DNCD commented Aug 8, 2024

For 1 domain, this one is pretty ok: https://wiki.debian.org/opendkim

For multiple domain, then google is your friend.

I need to write a tutorial, will try soon.

Thank you appreciate your help

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