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

Fix support for DKIM signing when forwarding and aliasing is enabled #2776

Merged
merged 2 commits into from Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions plugins/aliases.js
Expand Up @@ -112,6 +112,7 @@ function _alias (plugin, connection, key, config, host) {
connection.transaction.rcpt_to.pop();
connection.transaction.rcpt_to.push(toAddress);
}
connection.transaction.notes.forward = true;
}
else {
connection.loginfo(plugin, `alias failed for ${key}, no "to" field in alias config`);
Expand Down
2 changes: 2 additions & 0 deletions plugins/dkim_sign.js
Expand Up @@ -355,6 +355,8 @@ exports.get_sender_domain = function (connection) {
}
}

// In case of forwarding, only use the Envelope
if (txn.notes.forward) return domain;
if (!txn.header) return domain;

// the DKIM signing key should be aligned with the domain in the From
Expand Down