[Bug]: SMTP not using system name resolution #2869

Open
opened 2026-02-20 10:24:06 -05:00 by deekerman · 2 comments
Owner

Originally created by @scj643 on GitHub (Jul 6, 2025).

What happened?

I have an email server with split DNS on a RHEL 9 system. For some reason audiobookshelf is grabbing the public IP instead of the one set in /etc/hosts

What did you expect to happen?

Use the address set in /etc/hosts

Steps to reproduce the issue

  1. Set an email host where the address is set in /etc/hosts
  2. Test sending an email.

Audiobookshelf version

v2.25.1 (rpm)

How are you running audiobookshelf?

Other (list in "Additional Notes" box)

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

None

Logs

{
  "timestamp": "2025-07-06 10:07:04.395",
  "source": "EmailManager.js:17",
  "message": "[EmailManager] Failed to verify SMTP connection config Error: connect EHOSTUNREACH <public-ip>:587\n    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16) {\n  errno: -113,\n  code: 'ESOCKET',\n  syscall: 'connect',\n  address: '51.89.86.67',\n  port: 587,\n  command: 'CONN'\n}",
  "levelName": "ERROR",
  "level": 4
}

Additional Notes

No response

Originally created by @scj643 on GitHub (Jul 6, 2025). ### What happened? I have an email server with split DNS on a RHEL 9 system. For some reason audiobookshelf is grabbing the public IP instead of the one set in `/etc/hosts` ### What did you expect to happen? Use the address set in `/etc/hosts` ### Steps to reproduce the issue 1. Set an email host where the address is set in `/etc/hosts` 2. Test sending an email. ### Audiobookshelf version v2.25.1 (rpm) ### How are you running audiobookshelf? Other (list in "Additional Notes" box) ### What OS is your Audiobookshelf server hosted from? Linux ### If the issue is being seen in the UI, what browsers are you seeing the problem on? None ### Logs ```shell { "timestamp": "2025-07-06 10:07:04.395", "source": "EmailManager.js:17", "message": "[EmailManager] Failed to verify SMTP connection config Error: connect EHOSTUNREACH <public-ip>:587\n at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16) {\n errno: -113,\n code: 'ESOCKET',\n syscall: 'connect',\n address: '51.89.86.67',\n port: 587,\n command: 'CONN'\n}", "levelName": "ERROR", "level": 4 } ``` ### Additional Notes _No response_
Author
Owner

@Vito0912 commented on GitHub (Jul 6, 2025):

After scanning the code it looks like ABS uses nodemailer. Therefore looks like https://github.com/nodemailer/nodemailer/issues/1283.
@advplyr can you validate?

@Vito0912 commented on GitHub (Jul 6, 2025): After scanning the code it looks like ABS uses nodemailer. Therefore looks like https://github.com/nodemailer/nodemailer/issues/1283. @advplyr can you validate?
Author
Owner

@scj643 commented on GitHub (Jul 6, 2025):

Ok so this is related to the upstream package. Can we add an option to set tls.servername

@scj643 commented on GitHub (Jul 6, 2025): Ok so this is related to the upstream package. Can we add an option to set `tls.servername`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/audiobookshelf-advplyr#2869
No description provided.