[fix] "The resolved IP address corresponds to a local interface" (self hosted)
Open
S4r4h-O
opened this issue 7 months ago
•
8 comments
SMTP Envelope
Date & Time 5/16/25, 7:38 AM
MAIL FROM support@<my_domain.com>
RCPT TO
support@<my_domain.com>
Log Message
Unable to deliver email to the IP address [<vps_ip>] resolved for the Mail Exchange (MX) server of "<my_domain.com>". The resolved IP address corresponds to a local interface.
Message Headers
From "<my_domain.com>" support@<my_domain.com>
To "<my_domain.com>" support@<my_domain.com>
Subject <my_domain.com> – Email Deliverability Report Issue
Message-ID <fcb714d1-11e8-9de0-1698-e39da2f24985@<my_domain.com>>
Date Fri, 16 May 2025 10:38:08 +0000
MIME-Version 1.0
Content-Type multipart/alternative; boundary="--_NmP-11877084255b6410-Part_1"
# More detailed logs:
{
"bounce_category": "none",
"domains": [
"68263252ff31feea389d7b3f"
],
"is_empty_domains": false,
"domains_checked_at": "2025-05-16T10:38:13.158Z",
"err": {
"name": "Error",
"message": "Unable to deliver email to the IP address [<vps_ip>] resolved for the Mail Exchange (MX) server of "<my_domain.com>". The resolved IP address corresponds to a local interface.",
"stack": "Error: Unable to deliver email to the IP address [<vps_ip>] resolved for the Mail Exchange (MX) server of "<my_domain.com>". The resolved IP address corresponds to a local interface.\n at filterAddress (/app/node_modules/.pnpm/[email protected]/node_modules/mx-connect/lib/resolve-ip.js:63:34)\n at Array.filter ()\n at /app/node_modules/.pnpm/[email protected]/node_modules/mx-connect/lib/resolve-ip.js:100:39\n at Array.forEach ()\n at /app/node_modules/.pnpm/[email protected]/node_modules/mx-connect/lib/resolve-ip.js:98:29\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
"code": "InvalidIpAddress",
"response": "DNS Error: Unable to deliver email to the IP address [<vps_ip>] resolved for the Mail Exchange (MX) server of "<my_domain.com>". The resolved IP address corresponds to a local interface.",
"category": "dns",
"isCodeBug": false
},
"date": "2025-05-16T10:38:08.000Z",
"subject": "<my_domain.com> – Email Deliverability Report Issue",
"keywords": [
"b32812778b",
"b11d461d8b",
"66b6d75185"
],
"text_message": "Unable to deliver email to the IP address [<vps_ip>] resolved for the Mail Exchange (MX) server of "<my_domain.com>". The resolved IP address corresponds to a local interface.",
"message": "Unable to deliver email to the IP address [<vps_ip>] resolved for the Mail Exchange (MX) server of "<my_domain.com>". The resolved IP address corresponds to a local interface.",
"meta": {
"user": "682631ffff31feea389d7aba",
"email": "68271591bf585ff4865c62f6",
"domains": [
"68263252ff31feea389d7b3f"
],
"session": {
"envelope": {
"mailFrom": {
"address": "support@<my_domain.com>"
},
"rcptTo": [
{
"address": "support@<my_domain.com>"
}
]
},
"headers": {
"From": ""<my_domain.com>" <support@<my_domain.com>",
"To": ""<my_domain.com>" <support@<my_domain.com>",
"Subject": "<my_domain.com> – Email Deliverability Report Issue",
"Message-ID": "<fcb714d1-11e8-9de0-1698-e39da2f24985@<my_domain.com>",
"Date": "Fri, 16 May 2025 10:38:08 +0000",
"MIME-Version": "1.0",
"Content-Type": "multipart/alternative; boundary="--_NmP-11877084255b6410-Part_1""
},
"originalFromAddress": "support@<my_domain.com>"
},
"err": {
"name": "Error",
"message": "Unable to deliver email to the IP address [<vps_ip>] resolved for the Mail Exchange (MX) server of "<my_domain.com>". The resolved IP address corresponds to a local interface.",
"stack": "Error: Unable to deliver email to the IP address [<vps_ip>] resolved for the Mail Exchange (MX) server of "<my_domain.com>". The resolved IP address corresponds to a local interface.\n at filterAddress (/app/node_modules/.pnpm/[email protected]/node_modules/mx-connect/lib/resolve-ip.js:63:34)\n at Array.filter ()\n at /app/node_modules/.pnpm/[email protected]/node_modules/mx-connect/lib/resolve-ip.js:100:39\n at Array.forEach ()\n at /app/node_modules/.pnpm/[email protected]/node_modules/mx-connect/lib/resolve-ip.js:98:29\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
"code": "InvalidIpAddress",
"response": "DNS Error: Unable to deliver email to the IP address [<vps_ip>] resolved for the Mail Exchange (MX) server of "<my_domain.com>". The resolved IP address corresponds to a local interface.",
"category": "dns"
},
"level": "error",
"app": {
"name": "forward-email",
"version": "1.0.3",
"node": "v20.19.1",
"environment": "production",
"hostname": "smtp.<my_domain.com>",
"ip": "<vps_ip>",
"pid": 1,
"cluster": {
"isPrimary": true,
"isWorker": false,
"schedulingPolicy": 2
},
"os": {
"arch": "x64",
"cpus": [
{
"model": "AMD EPYC 9354P 32-Core Processor",
"speed": 0,
"times": {
"user": 819920,
"nice": 48080,
"sys": 454250,
"idle": 8924150,
"irq": 0
}
},
{
"model": "AMD EPYC 9354P 32-Core Processor",
"speed": 0,
"times": {
"user": 809820,
"nice": 44380,
"sys": 425010,
"idle": 9088920,
"irq": 0
}
}
],
"endianness": "LE",
"freemem": 6578036736,
"priority": 0,
"homedir": "/root",
"hostname": "smtp.<my_domain.com>",
"loadavg": [
0.77,
0.41,
0.6
],
"network_interfaces": {
"lo": [
{
"address": "127.0.0.1",
"netmask": "255.0.0.0",
"family": "IPv4",
"mac": "00:00:00:00:00:00",
"internal": true,
"cidr": "127.0.0.1/8"
},
{
"address": "::1",
"netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
"family": "IPv6",
"mac": "00:00:00:00:00:00",
"internal": true,
"cidr": "::1/128",
"scopeid": 0
}
],
"eth0": [
{
"address": "<vps_ip>",
"netmask": "255.255.255.0",
"family": "IPv4",
"mac": "fc:e8:d4:b1:88:d6",
"internal": false,
"cidr": "<vps_ip>/24"
},
{
"address": "2a02:4780:14:4612::1",
"netmask": "ffff:ffff:ffff::",
"family": "IPv6",
"mac": "fc:e8:d4:b1:88:d6",
"internal": false,
"cidr": "2a02:4780:14:4612::1/48",
"scopeid": 0
},
{
"address": "fe80::fee8:d4ff:feb1:88d6",
"netmask": "ffff:ffff:ffff:ffff::",
"family": "IPv6",
"mac": "fc:e8:d4:b1:88:d6",
"internal": false,
"cidr": "fe80::fee8:d4ff:feb1:88d6/64",
"scopeid": 2
}
]
},
"platform": "linux",
"release": "5.15.0-140-generic",
"tmpdir": "/tmp",
"totalmem": 8322453504,
"type": "Linux",
"uptime": 11078.15,
"user": {
"uid": 0,
"gid": 0,
"username": "root",
"homedir": "/root",
"shell": "/bin/bash"
},
"version": "#150-Ubuntu SMP Sat Apr 12 06:00:09 UTC 2025"
},
"worker_threads": {
"isMainThread": false,
"resourceLimits": {
"maxYoungGenerationSizeMb": 48,
"maxOldGenerationSizeMb": 2048,
"codeRangeSizeMb": 0,
"stackSizeMb": 4
},
"threadId": 1,
"workerData": {
"job": {
"name": "send-emails",
"interval": 30000,
"timeout": 0,
"path": "/app/jobs/send-emails.js",
"timezone": "local"
}
}
}
}
},
"created_at": "2025-05-16T10:38:12.963Z",
"is_restricted": true,
"id": "68271594183cf1756b69cd90",
"object": "log",
"updated_at": "2025-05-16T10:38:12.963Z"
}
From the mx container, if I dig the DOMAIN or hostname then I should get back the VPS IP. Are you getting a response of 127.0.0.1 / loopback address? You may need to add a hostname or label configuration on the VPS provider to ensure that the hostname binds and resolves to the VPS IP even from within the host and container (using dockers network mode host)
@AlexP38 You can try setting (or changing) AXE_SILENT=falseAXE_SHOW_META=trueAXE_SHOW_STACK=true in your .env file on your server for this project's git repo, then reload, and then watch the logs for the full stack trace when this happens - then send it here so I can look closer (this might be happening elsewhere)
Also @AlexP38 you can also join our Matrix chat for real-time chat with myself and @shaunwarman so we can help further
To join, go to https://matrix.to/#/#forwardemail:matrix.org
It doesn't appear like your variable is set to false properly, or not rebooted perhaps?
You could edit the mx-connect codebase / pnpm file in your log output and do a console.log('dnsOptions', dnsOptions) to see what it's being passed, and also a console.log('stack', new Error('stack').stack); to get full stack trace.
I finally found my error:
change this in the file /app/helpers/get-transporter.js within the smtp_bree container, not the mx container!
blockLocalAddresses: false,
Then it is working.
But: What about if the autoupdater makes an update? Is it possible to make this a .env variable to keep it?