Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When I go to the local terminal on my Exchange box (SBS 2008) I can do this:

telnet 127.0.0.1 25
220 Exchange banner here
EHLO example.com
250 Server name

However when I go from another box, or from the actual IP of the server I get this:

telnet 192.168.21.20 25
220 Exchange banner here
EHLO example.com
421 4.4.1 Connection timed out

Connection to host lost.

The odd thing is, this server is currently in production and working fine (receiving mail for our entire domain). But my C# programs can't send mail to it (they get this same error).

Any ideas?

share|improve this question

2 Answers 2

The Exchange server appears to be trying to connect back to you (something like ident?), so you should try a packet sniffer (like Wireshark) to see where it is trying to connect.


Another way to interpret that message. SMTP, like most internet protocols, uses CR/LF pair as line terminator. And so does the telnet protocol. However, it might happen that in your second example, the client (is it "telnet" or something else?) does not send the correct line ending - maybe it sends just LF or something entirely different. Again, use Wireshark to find out.


Related to #2 above: Maybe your second machine has an antivirus program that tries to be smart and intercepts SMTP connections? I've seen many occassions of them breaking POP3.

share|improve this answer

In your application are you using a standard smtp lib or are you sending the commands down a raw socket? If you are sending the commands down raw check whether or not you are sending a \r\n after the command.

J

share|improve this answer
    
Well telnet isn't working either, so it's a bigger issue than my program. But no I'm using the standard .NET System.Net libraries. –  Timothy Baldridge Feb 17 '10 at 23:57
    
Are you telneting to localhost on the server or to the publicly facing IP? J –  James Feb 18 '10 at 0:36
    
localhost works (as shown above), public ip does not. I'd think it would be a windows firewall issue, but I get the server connection banner. –  Timothy Baldridge Feb 18 '10 at 2:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.