I am trying to telnet to my mail server on port 25 and I keep getting:
telnet mydomain.com 25
Trying ip address...
telnet: connect to address ipaddress: Connection refused
When I log onto the server and do:
telnet localhost 25
it works fine. The port is not blocked. I checked with my hosting company…
I am uinsg Postfix as the Mail Transfer Agent. That’s all set up fine. I copied the settings from another mail server I was using, which is working fine.
Thanks for your reply… I am trying from within the same network. Both machines are separated only by the last two digits of the ip address, one is xx.xxx.xxx.76 and the other is xx.xxx.xxx.92
Ping works fine… I am getting a reply.
Netstat is as follows:
netstat -at
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 vps-number.cp:smtp *:* LISTEN
tcp 0 0 *:sunrpc *:* LISTEN
tcp 0 232 mail.mydomain.com:ssh ipaddress:45446 ESTABLISHED
That netstat -at doesn’t have enough information. Postfix seems to be binding to one address, but exactly what address isn’t known. Please do netstat -atn.
netstat -atn
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 232 mail server ip:22 some other ip:45446 ESTABLISHED
Simple, you have not instructed postfix to listen on all interfaces, so by default it only listens on localhost.
The configuration variable in /etc/postfix/main.cf is inet_interfaces. As shipped it only listens to localhost. If you have not modified main.cf yourself, the place to do it in YaST is /etc/sysconfig/mail, setting SMTPD_LISTEN_REMOTE.
Hm, I am afraid ken_yap knows more in this area, bur what I see is that a process is listening on port 25 on 127.0.0.1 (localhost) and not on your external IP address. Is that a config error in your mail server?
Is hiding the IP addresses from us realy needed? After all they are only internal addresses of your LAN. You may hide usefull information for us. You say you ping to mydomain.com, which is normaly a domain and not a host. I also see mail.mydomain.com which is most probably a host. I am a bit confused.
Edit: In the meantime ken_yap came not only to the same conclusion as I: not configured to listen on others addresses then localhost. But he also knows exactly what to change. As I said, he has more knowledge about this than I, so forget this post.
Thanks very much… I got this working. I fiddled around with my postfix master.cf and it’s now listening properly. There was a line:
smtp inet n - n - - smtpd
which was commented in. I commented it out and checked netstat again, and it wasn’t listening on anything. So I commented it in again… Then instead of doing: