I am having trouble sending mail from Linux to Exchange server. When I telnet from Linux to Windows on port 25, I am not receiving any message from Exchange. The connection is automatically terminated after few seconds of wait.
Using tcpdump I can see that Windows keeps sending SYN+ACK and finally closing connection. Even though Linux responds with ACK message, it is not seen by Windows. If I send some message (telnet test) without waiting for Exchange 'greeting', the connection works.
I had verified Windows firewall and connection from Linux machine is allowed and I cannot find any packets dropped message in firewall logs.
Connection from Windows to Linux port 25 works fine.
Details:
Windows: x.x.x.243 / 255.255.255.128; gateway = x.x.x.129
Linux: x.x.x.145 / 255.255.255.128; gateway = x.x.x.129
Linux to Windows tcpdump
root@yy01:~# tcpdump -nni eth0 host x.x.x.243 and port 25 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes 05:03:58.846266 IP x.x.x.145.45104 > x.x.x.243.25: Flags [S], seq 3228055127, win 29200, options [mss 1000,sackOK,TS val 659649138 ecr 0,nop,wscale 7], length 0 05:03:58.849071 IP x.x.x.243.25 > x.x.x.145.45104: Flags [S.], seq 37978062, ack 3228055128, win 8192, options [mss 1460,nop,wscale 8,sackOK,TS val 316999749 ecr 659649138], length 0 05:03:58.849097 IP x.x.x.145.45104 > x.x.x.243.25: Flags [.], ack 1, win 229, options [nop,nop,TS val 659649139 ecr 316999749], length 0 05:04:01.858960 IP x.x.x.243.25 > x.x.x.145.45104: Flags [S.], seq 37978062, ack 3228055128, win 8192, options [mss 1460,nop,wscale 8,sackOK,TS val 317000050 ecr 659649138], length 0 05:04:01.859001 IP x.x.x.145.45104 > x.x.x.243.25: Flags [.], ack 1, win 229, options [nop,nop,TS val 659649891 ecr 316999749], length 0 05:04:07.874811 IP x.x.x.243.25 > x.x.x.145.45104: Flags [S.], seq 37978062, ack 3228055128, win 65535, options [mss 1460,sackOK,TS val 317000651 ecr 659649138], length 0 05:04:07.874872 IP x.x.x.145.45104 > x.x.x.243.25: Flags [.], ack 1, win 229, options [nop,nop,TS val 659651395 ecr 316999749], length 0 05:04:19.875384 IP x.x.x.243.25 > x.x.x.145.45104: Flags [R], seq 37978063, win 0, length 0 Linux to Windows tcpdump with some data send without waiting for greeting
root@yy01:~# tcpdump -nni eth0 host x.x.x.243 and port 25 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes 05:06:30.521152 IP x.x.x.243.25 > x.x.x.145.45234: Flags [R], seq 1489851708, win 0, length 0 05:06:31.253677 IP x.x.x.145.45246 > x.x.x.243.25: Flags [S], seq 3514263924, win 29200, options [mss 1000,sackOK,TS val 659687240 ecr 0,nop,wscale 7], leng th 0 05:06:31.256475 IP x.x.x.243.25 > x.x.x.145.45246: Flags [S.], seq 3020263353, ack 3514263925, win 8192, options [mss 1460,nop,wscale 8,sackOK,TS val 317014 989 ecr 659687240], length 0 05:06:31.256520 IP x.x.x.145.45246 > x.x.x.243.25: Flags [.], ack 1, win 229, options [nop,nop,TS val 659687241 ecr 317014989], length 0 05:06:34.255733 IP x.x.x.243.25 > x.x.x.145.45246: Flags [S.], seq 3020263353, ack 3514263925, win 8192, options [mss 1460,nop,wscale 8,sackOK,TS val 317015 289 ecr 659687240], length 0 05:06:34.255782 IP x.x.x.145.45246 > x.x.x.243.25: Flags [.], ack 1, win 229, options [nop,nop,TS val 659687990 ecr 317014989], length 0 05:06:36.720344 IP x.x.x.145.45246 > x.x.x.243.25: Flags [P.], seq 1:3, ack 1, win 229, options [nop,nop,TS val 659688607 ecr 317014989], length 2: SMTP: 05:06:36.924198 IP x.x.x.145.45246 > x.x.x.243.25: Flags [P.], seq 1:3, ack 1, win 229, options [nop,nop,TS val 659688658 ecr 317014989], length 2: SMTP: 05:06:37.176212 IP x.x.x.145.45246 > x.x.x.243.25: Flags [P.], seq 1:3, ack 1, win 229, options [nop,nop,TS val 659688721 ecr 317014989], length 2: SMTP: 05:06:37.680210 IP x.x.x.145.45246 > x.x.x.243.25: Flags [P.], seq 1:3, ack 1, win 229, options [nop,nop,TS val 659688847 ecr 317014989], length 2: SMTP: 05:06:38.688207 IP x.x.x.145.45246 > x.x.x.243.25: Flags [P.], seq 1:3, ack 1, win 229, options [nop,nop,TS val 659689099 ecr 317014989], length 2: SMTP: 05:06:40.271716 IP x.x.x.243.25 > x.x.x.145.45246: Flags [S.], seq 3020263353, ack 3514263925, win 65535, options [mss 1460,sackOK,TS val 317015890 ecr 659687240], length 0 05:06:40.271765 IP x.x.x.145.45246 > x.x.x.243.25: Flags [.], ack 1, win 229, options [nop,nop,TS val 659689494 ecr 317014989], length 0 05:06:40.708211 IP x.x.x.145.45246 > x.x.x.243.25: Flags [P.], seq 1:3, ack 1, win 229, options [nop,nop,TS val 659689604 ecr 317014989], length 2: SMTP: 05:06:44.748217 IP x.x.x.145.45246 > x.x.x.243.25: Flags [P.], seq 1:3, ack 1, win 229, options [nop,nop,TS val 659690614 ecr 317014989], length 2: SMTP: 05:06:44.751495 IP x.x.x.243.25 > x.x.x.145.45246: Flags [P.], seq 1:93, ack 3, win 65533, options [nop,nop,TS val 317016338 ecr 659690614], length 92: SMTP: 220 EXxx.yyyy.local Microsoft ESMTP MAIL Service ready at Thu, 4 Feb 2016 05:06:44 +0100 Please advise on possible cause of this issue.
NB: I had asked same question on stackoverflow and they advised to ask here.
Thank you,
iptables -L -n -v