Skip to content

Commit

Permalink
Fix support for DKIM signing when forwarding and aliasing is enabled
Browse files Browse the repository at this point in the history
This partially fix haraka#2774
  • Loading branch information
Cyril RUSSO committed Mar 23, 2020
1 parent 133e0b1 commit 0478ea5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions plugins/aliases.js
Original file line number Diff line number Diff line change
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
3 changes: 2 additions & 1 deletion plugins/dkim_sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,8 @@ exports.get_sender_domain = function (connection) {
}
}

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

// the DKIM signing key should be aligned with the domain in the From
// header (see DMARC). Try to parse the domain from there.
Expand Down

0 comments on commit 0478ea5

Please sign in to comment.