diff --git a/plugins/aliases.js b/plugins/aliases.js index 2b385e8ea..209fea63a 100644 --- a/plugins/aliases.js +++ b/plugins/aliases.js @@ -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`); diff --git a/plugins/dkim_sign.js b/plugins/dkim_sign.js index 662d0512d..9523f7e4c 100644 --- a/plugins/dkim_sign.js +++ b/plugins/dkim_sign.js @@ -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