mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 00:35:51 +03:00
[GH-ISSUE #642] Amazon SES SMTP Relay error: error closing connection: 554 Transaction failed: Duplicate header 'DKIM-Signature'. #402
Labels
No labels
awaiting feedback
bug
docker
documentation
enhancement
github_actions
invalid
pull-request
question
stale
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mailpit#402
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @hossein on GitHub (Feb 12, 2026).
Original GitHub issue: https://github.com/axllent/mailpit/issues/642
Hi. I have a system that sends emails using Amazon SES to our own mailpit server. The sending identity on SES is configured with successful DKIM configuration, and mailpit shows a
Dkim-Signatureheader in the received email.I have configured mailpit's SMTP Relay with SMTP credentials from Amazon SES. But when trying to release an email from mailpit UI to any address, the following error is displayed:
Providing another verified SES identity to
override-fromin mailpit's smtp relay config doesn't help neither. Any ideas?@axllent commented on GitHub (Feb 12, 2026):
Hi there. So you're using SES to deliver mail to Mailpit, and then also relaying messages via SES? Can SES be configured not to add dkim signatures via the incoming route (delivering to Mailpit)?
@github-actions[bot] commented on GitHub (Feb 20, 2026):
This issue has been marked as stale because it has been open for 7 days with no activity.
@github-actions[bot] commented on GitHub (Feb 23, 2026):
This issue was closed because there has been no activity since being marked as stale.
@hossein commented on GitHub (Feb 26, 2026):
@axllent Thanks for your response and sorry for the delay; please re-open.
For some reason, disabling the DKIM signatures on SES's panel still adds them to the email for me (might be our complex identity setup with subdomains, etc).
However, I'm trying to understand what is going on here. If I check the raw headers there are already two
DKIM-Signatureheaders (example below), which seems to be the expected behavior.Does MailPit touch DKIM headers (or any other headers for that matter) while releasing/relaying? If no, can we somehow bypass any validation that is being done here to make it able to release the message regardless of any errors?
@axllent commented on GitHub (Feb 27, 2026):
No, Mailpit does not modify any headers - except for the message ID itself (see notes).
Mailpit does not validate any DKIM headers. The error you are getting (
SMTP error: error closing connection: 554 Transaction failed: Duplicate header 'DKIM-Signature'.) is the response from the second SES SMTP server. 🤷 Mailpit is not rejecting it, the second SES server is.@hossein commented on GitHub (Feb 27, 2026):
Ok, I was under the impression that the error is coming from the sending mechanism.
For some reason, it's not easily possible to do it from our initial sending side (and even disabling SES's DKIM signing apparently still leaves one DKIM header there instead of two, but haven't tested if it causes the same issue).
Are there possible alternatives in the mailpit side, such as stripping the DKIM headers during relaying?
@axllent commented on GitHub (Mar 1, 2026):
There isn't currently any option in Mailpit to remove headers, but to be honest, this issue doesn't really sound like a problem that needs to be solved by Mailpit either. If you're getting one set of DKIM headers now, then it means one of the SMTP servers still has that configured.
@hossein commented on GitHub (Mar 1, 2026):
Thanks for the insights. Here is a summary; I'll report what worked.