IIS 5 & IIS 6
Windows Server 2019: Built-in SMTP server not honoring MX records?
Last post Feb 21, 2019 03:12 PM by Brunnis
Feb 18, 2019 09:21 PM|Brunnis|LINK
I'm setting up a new dedicated server using Windows Server 2019. It's replacing an old one based on Windows Server 2008 R2. I have had the built-in SMTP server running on the old server with no issues. I have set up the new server to act as an SMTP server
as well, using my own notes from setting up the old one, as well as double checking intructions online. Basically according to the instructions here:
It's pretty much the simplest setup possible, just using the SMTP server locally (only allows connections from 127.0.0.1) with anonymous access enabled.
The problem I'm having is that e-mail will not leave C:\inetpub\mailroot\Queue and will never reach the recipients. The Windows event log contains the following warning(s):
Event 4006, smtpsvc
"Message delivery to the host '18.104.22.168' failed while delivering to the remote domain 'hotmail.com' for the following reason: The remote server did not respond to a connection attempt."
The above is just an example using a Hotmail destination address. The same kind of message is received when trying to send to addresses on other domains.
What I've tried:
That last item above also ties into an interesting thing that I noticed, which is that the IP address listed in the event 4006 log message is not one of the IP addresses listed in the MX records. It is the IP address of the actual hotmail.com domain (or
the IP of any other domain I try to send to). So, why is it attempting to contact the domain in the e-mail address and not one of the addresses listed in the MX records?
To futher investigate, I used Telnet to send to an e-mail in one of my own domains. Sure enough, I find a 4006 event in the log saying:
"Message delivery to the host '[my domain's IP]' failed while delivering to the remote domain '[my domain]' for the following reason: The connection was dropped by the remote host."
It again appears that the SMTP server is trying to connect to my domain's IP and port 25 and not to the address specified in the MX record.
This is as far as I've come. Maybe I'm misinterpreting something here, but it certainly looks like Windows' SMTP server is trying to connect to the e-mail address' domain directly at port 25 (ignoring MX records)... Any ideas on what I might be doing wrong
or perhaps how I should proceed in troubleshooting this?
Feb 21, 2019 03:12 PM|Brunnis|LINK
I have continued investigating this issue and now believe it's a bug in Windows Server 2019. I have found both how to send mail correctly and how to reproduce this issue with 100% certainty.
Mail will not be sent correctly if the SMTP service start-up type is set to "Automatic" (i.e. start immediately on boot). If the SMTP service is set to manual start and then started manually from either services.msc or from IIS6 manager, e-mail will leave
the queue and get delivered to the recipients.
If "Automatic" start-up is used for the service, any attempts to send e-mail will always result in the e-mail getting stuck in the queue and the event 4006 (see initial post above for details) getting written to the event log.
This is 100% reproducible in my testing. A work-around is to set the start-up type to "Automatic (Delayed Start)". This will, if I am correctly informed, result in the SMTP service getting started 2 minutes after the last "Automatic" service has been started.
This is not an optimal solution, but it'll do for the time being.
It would probably be good to get this information to Microsoft's developers.
Step-by-step to reproduce the issue: