Skip to content

Commit

Permalink
in case of catchall address, add custom header to read the original r…
Browse files Browse the repository at this point in the history
…ecipient
  • Loading branch information
NickOvt committed Nov 20, 2024
1 parent 91745b5 commit 547b4ed
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,11 @@ exports.real_rcpt_handler = function (next, connection, params) {
return hookDone(err);
}

if (addressData.address.includes('*')) {
// wildcard/catchall address received email
txn.add_header('X-Zone-Original-Rcpt', address);
}

if (addressData && addressData.targets) {
return plugin
.handle_forwarding_address(connection, address, addressData)
Expand Down

0 comments on commit 547b4ed

Please sign in to comment.