I was recently doing some troubleshooting of email delivery on an Exim server.
I wanted to see what happens when the server attempts delivery. The error in the logs was a timeout, but it does not tell you when in the process the timeout happens.
Expanding on some of his examples I used this command:
exim -v -M <message-id>
That command will force Exim to attempt a delivery of the message you define as the message-id. The addition of -v will show every step of the process, very handy.
In my test using this tool, the delivery failed. In fact, it could not even connect to the remote server at all. Yet, if I did a telnet command like this:
telnet 123.345.679.123 25
I could connect to the remote server. After some digging, I found the exim.conf file was using a command on the transport to bind the outbound connections to an IP address on the server other than the default IP.
interface = <; 192.168.123.123
The network then had special rules on the firewall to direct outbound traffic from that IP address to a specific public IP address.
So my telnet command that was giving me a positive result, I could connect to the remove server but only because my test was not simulating the same outbound IP address as the server.
If you need to telnet out of a server and bind to a specific IP address, you can do it like this:
telnet -b <sourceaddress> <destination> <port>