diff --git a/Changes.md b/Changes.md index 94dc8cca4..54cb5167c 100644 --- a/Changes.md +++ b/Changes.md @@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). ### Unreleased + +- fix(outbound): in outbound hook_delivered, when mx.exchange contains + an IP, use mx.from_dns + ### [3.0.5] - 2024-09-27 #### Fixed diff --git a/outbound/hmail.js b/outbound/hmail.js index 677b65575..65626da9e 100644 --- a/outbound/hmail.js +++ b/outbound/hmail.js @@ -598,10 +598,10 @@ class HMailItem extends events.EventEmitter { if (success) { const reason = response.join(' '); - let hostname = mx.exchange - if (net.isIP(hostname) && mx.from_dns && !net.isIP(mx.from_dns)) { - hostname = mx.from_dns - } + let hostname = mx.exchange + if (net.isIP(hostname) && mx.from_dns && !net.isIP(mx.from_dns)) { + hostname = mx.from_dns + } self.delivered(host, port, (mx.using_lmtp ? 'LMTP' : 'SMTP'), hostname, reason, ok_recips, fail_recips, bounce_recips, secured, authenticated);