Problem sending mail from localhost

For any other discussion relating to MailEnable.
Post Reply
didrik
Posts: 2
Joined: Wed Oct 03, 2012 10:23 am

Problem sending mail from localhost

Post by didrik »

I just experienced a very odd problem and thought my solution might help somebody else.

We have an application running on the same server where we run MailEnable and that application sends emails via "localhost", which always used to work, but yesterday our emails were not being received.

Getting straight to the crux, I discovered that "telnet 127.0.0.1 25" would successfully connect to MailEnable and let me issue SMTP commands but that "telnet localhost 25" would receive a 530 access denied message.

I've fixed the problem by putting an entry for 127.0.0.1 localhost into the hosts file on the server. (I had previously thought that "localhost" was universally understood that it appears not to be the case.)

HTH

Didrik

MailEnable
Site Admin
Posts: 4441
Joined: Tue Jun 25, 2002 3:03 am
Location: Melbourne, Victoria Australia

Re: Problem sending mail from localhost

Post by MailEnable »

It is possible that the computer is configured with IPv6. If thats the case it is likely to resolve localhost to the IPv6 equivilent of localhost, which is "::1" (and as you say, IPV4 is "127.0.0.1").
You can establish this by running "ping localhost" from the windows command prompt (it will resolve the name to its IP, and will tell you whether its resulting in ::1 or 127.0.0.1).
Regards, Andrew

didrik
Posts: 2
Joined: Wed Oct 03, 2012 10:23 am

Re: Problem sending mail from localhost

Post by didrik »

Thanks for your response, Andrew. I think you are probably quite correct although it's a little hard to verify as I can't go removing my hosts file entry that resolved the issue.

If I ping localhost at the moment I get a response from the IPv4 address, 127.0.0.1, but that is probably because of my hosts file entry.

If I tell the ping command to use IPv6 then I get a response from ::1 and, as there is no ::1 entry in my hosts file, I think that corroborates your theory rather well.

Code: Select all

ping localhost -6
Pinging real.name.here [::1] with 32 bytes of data:
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Didrik

Post Reply