Talking to SMTP / Mail via telnet to diagnoze mail problems on a server
Mailserver diagnoses can be tricky: I personally find the easiest way to do it still using telnet in combination with the server logs to find out what exactly is wrong.
It is very easy to do:
telnet thehost.com 25
helo: myhost.com
mail from: me@myhost.com
rcpt to: someone@thehost.com
data
... type some data ...
.
quit
That is all; it will help to exactly determine where it goes wrong.
The case we had today;
- postfix didn't send mail ; it gave connection refused
- thoughts; firewall, network, dns etc.
- we tried the above and it worked fine, meaning postfix was the one refusing, not the network/firewall etc
- we fixed the postfix config and all was fine
