[clue-tech] routing question [symptoms in postfix smtpd ]

Jim Ockers ockers at ockers.net
Thu Jul 28 06:13:32 MDT 2005


Hi Jeff,

Your post is very long so I'm going to intentionally top-post. :)
This doesn't look like a network problem to me.

Your java exception seems to be thrown because the receiving mail
server gave a "501 Syntax: HELO hostname" error.  Any 5xx error message
means that the server is telling the client to Go Away.  Your client
javax.mail is actually doing the right thing by closing the connection 
and failing to send the mail.

Could you please re-try your telnet command-line mail sending but
try just HELO as the first command, no arguments.  Maybe that will 
make your postfix return "501 Syntax: HELO hostname" .

My sendmail doesn't like a plain HELO either, and throws a 501:

[141] tahoua.ockers.net:/home/ockers > telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 tahoua.ockers.net ESMTP Sendmail 8.11.6/8.11.6; Thu, 28 Jul 2005 06:11:02 -0600
HELO
501 5.0.0 HELO requires domain address

In any case it looks to me like you have to convince your Java class
javax.mail to say "HELO bluespark" as the first SMTP command.  Maybe
your Java class can't lookup the hostname or something.  Put in a debug
line so you can see exactly what's printed to the mail server in the
HELO line.

Incidentally your tcpdump output is very thorough but it obviously
doesn't contain enough information for me to see where that 501 is
coming from or why.  An ethereal .pcap file would be more useful for 
troubleshooting this.

Good luck!

Hope this helps,
Jim

--
Jim Ockers, P.Eng. (ockers at ockers.net)
Contact info: please see http://www.ockers.net/

Jeff Cann wrote:
> 
> Hi.
> 
> I have what I think is an issue with network routing.  Here's the scenario:
> 
> 1.  Qwest DSL with a static IP.
> 2.  One linux box portmapped to the outside world for HTTP, SMTP.  This is the 
> one I'm having trouble with.  (aka 'the production box' ; hostname 
> 'bluespark')
> 3.  Another linux box portmapped to the outside world for SSH only (aka 'the 
> development box' ; hostname 'jumanji' ).
> 4.  Both boxes are running postfix on FC4.  I think this is irrelevant, but 
> the problem shows itself when sending email.  Production box receives 
> internet email correctly.  Both send email from command line, both accept 
> email send manually from command line.
> 5.  I'm doing all of this from inside my LAN.
> 
> At issue:  java program that sends email.   It works on development box but 
> not on production. The problem started when I switched to DSL.  So, I think 
> it's an environmental problem, but I'm at a loss as to why.  
> 
> I have some loopback tcpdump information, but I just don't know TCP/IP well - 
> enough to understand what's happening during an attempt to send email.
> 
> I appreciate any suggestions for further tests or any possible solutions.
> Gracias,
> Jeff
> 
> ========== javax mail program ================
> 
> javax.mail.SendFailedException: Sending failed;
>   nested exception is:
>         class javax.mail.MessagingException: 501 Syntax: HELO hostname
> 
>         at javax.mail.Transport.send0(Transport.java:218)
>         at javax.mail.Transport.send(Transport.java:80)
>         at com.tourneysoft.util.EmailUtil.send(EmailUtil.java:63)
>         at com.tourneysoft.util.TestEmail.main(TestEmail.java:20)
> Found an exception :Sending failed;
>   nested exception is:
>         class javax.mail.MessagingException: 501 Syntax: HELO hostname
> 
> ============== postfix log for the mail attempt =============
> Jul 27 23:29:33 cberry postfix/smtpd[16865]: connect from 
> bluespark[192.168.0.5]
> Jul 27 23:29:33 cberry postfix/smtpd[16865]: lost connection after HELO from 
> bluespark[192.168.0.5]
> Jul 27 23:29:33 cberry postfix/smtpd[16865]: disconnect from 
> bluespark[192.168.0.5]
> 
> ============ manual email test ===============
> Here's me manually sending an email to the eth0 interface --> OK (same result 
> for loopback).  I can also do this from jumanji, connecting to bluespark --> 
> OK
> 
> $ telnet 192.168.0.5 25
> Trying 192.168.0.5...
> Connected to 192.168.0.5.
> Escape character is '^]'.
> 220 bluespark ESMTP Postfix
> HELO bluespark
> 250 bluespark
> MAIL FROM: jccann at gmail.com
> 250 Ok
> RCPT TO: jcann at bluespark
> 250 Ok
> DATA
> 354 End data with <CR><LF>.<CR><LF>
> Subject: Test
> 
> Test
> .
> 250 Ok: queued as BDDF053316
> QUIT
> 221 Bye
> 
> The remaining files are from bluespark (production) box
> ============ ifconfig eth0 ===============
> eth0      Link encap:Ethernet  HWaddr 00:30:48:41:D2:2A
>           inet addr:192.168.0.5  Bcast:192.168.0.255  Mask:255.255.255.0
>           inet6 addr: fe80::230:48ff:fe41:d22a/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:301794 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:278657 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:144020957 (137.3 MiB)  TX bytes:158820533 (151.4 MiB)
>           Base address:0xa000 Memory:ec000000-ec020000
> 
> =============== /etc/resolv.conf ===============
> # Note:  These are the Qwest.net name servers.
> # When I had nameserver 192.168.0.1, name resolutions were slower.
> nameserver 205.171.3.65
> nameserver 205.171.2.65
> 
> =============== iptables --list =================
> iptables --list
> Chain FORWARD (policy ACCEPT)
> target     prot opt source               destination
> 
> Chain INPUT (policy ACCEPT)
> target     prot opt source               destination
> 
> Chain OUTPUT (policy ACCEPT)
> target     prot opt source               destination
> 
> ================ /etc/hosts ==============
> 127.0.0.1       localhost
> 192.168.0.5     bluespark mail.example.com www.example.com
> 192.168.0.4     jumanji
> 
> ============= tcpdump failed send ===================
> Note:  This dump is for loopback for the packet headers generated when I run 
> the java mail program (which fails to send mail).  I grep'd out the packets 
> using 'grep smtp tcpdump.out'
> 
> 23:46:46.442222 IP bluespark.33018 > bluespark.smtp: S 2016396620:2016396620
> (0) win 32767 <mss 16396,sackOK,timestamp 781343018 0,nop,wscale 2>
> 23:46:46.442258 IP bluespark.smtp > bluespark.33018: S 2006672304:2006672304
> (0) ack 2016396621 win 32767 <mss 16396,sackOK,timestamp 781343018 
> 781343018,nop,wscale 2>
> 23:46:46.442292 IP bluespark.33018 > bluespark.smtp: . ack 1 win 8192 
> <nop,nop,timestamp 781343018 781343018>
> 23:46:46.443080 IP bluespark.smtp > bluespark.33018: P 1:30(29) ack 1 win 8192 
> <nop,nop,timestamp 781343019 781343018>
> 23:46:46.443115 IP bluespark.33018 > bluespark.smtp: . ack 30 win 8192 
> <nop,nop,timestamp 781343019 781343019>
> 23:46:46.595169 IP bluespark.33018 > bluespark.smtp: P 1:7(6) ack 30 win 8192 
> <nop,nop,timestamp 781343171 781343019>
> 23:46:46.595203 IP bluespark.smtp > bluespark.33018: . ack 7 win 8192 
> <nop,nop,timestamp 781343171 781343171>
> 23:46:46.595497 IP bluespark.smtp > bluespark.33018: P 30:57(27) ack 7 win 
> 8192 <nop,nop,timestamp 781343171 781343171>
> 23:46:46.595607 IP bluespark.33018 > bluespark.smtp: . ack 57 win 8192 
> <nop,nop,timestamp 781343171 781343171>
> 23:46:46.739118 IP bluespark.33018 > bluespark.smtp: P 7:13(6) ack 57 win 8192 
> <nop,nop,timestamp 781343315 781343171>
> 23:46:46.739371 IP bluespark.smtp > bluespark.33018: P 57:84(27) ack 13 win 
> 8192 <nop,nop,timestamp 781343315 781343315>
> 23:46:46.739487 IP bluespark.33018 > bluespark.smtp: . ack 84 win 8192 
> <nop,nop,timestamp 781343315 781343315>
> 23:46:46.747006 IP bluespark.33018 > bluespark.smtp: F 13:13(0) ack 84 win 
> 8192 <nop,nop,timestamp 781343323 781343315>
> 23:46:46.747668 IP bluespark.smtp > bluespark.33018: F 84:84(0) ack 14 win 
> 8192 <nop,nop,timestamp 781343323 781343323>
> 23:46:46.747706 IP bluespark.33018 > bluespark.smtp: . ack 85 win 8192 
> <nop,nop,timestamp 781343324 781343323>
> 
> ============= tcpdump successful send ===================
> Note:  This dump is for loopback for the packet headers generated when I 
> telnet to port 25 on lo interface and manually send an email.  I grep'd out 
> the packets using 'grep smtp tcpdump.out'
> 
> 23:52:36.448263 IP localhost.58581 > localhost.smtp: S 2371970892:2371970892
> (0) win 32767 <mss 16396,sackOK,timestamp 781693077 0,nop,wscale 2>
> 23:52:36.448950 IP localhost.smtp > localhost.58581: S 2382935761:2382935761
> (0) ack 2371970893 win 32767 <mss 16396,sackOK,timestamp 781693077 
> 781693077,nop,wscale 2>
> 23:52:36.448442 IP localhost.58581 > localhost.smtp: . ack 1 win 8192 
> <nop,nop,timestamp 781693077 781693077>
> 23:52:36.504923 IP localhost.smtp > localhost.58581: P 1:30(29) ack 1 win 8192 
> <nop,nop,timestamp 781693134 781693077>
> 23:52:36.505075 IP localhost.58581 > localhost.smtp: . ack 30 win 8192 
> <nop,nop,timestamp 781693134 781693134>
> 23:52:40.444726 IP localhost.58581 > localhost.smtp: P 1:17(16) ack 30 win 
> 8192 <nop,nop,timestamp 781697074 781693134>
> 23:52:40.444758 IP localhost.smtp > localhost.58581: . ack 17 win 8192 
> <nop,nop,timestamp 781697074 781697074>
> 23:52:40.445060 IP localhost.smtp > localhost.58581: P 30:45(15) ack 17 win 
> 8192 <nop,nop,timestamp 781697075 781697074>
> 23:52:40.445085 IP localhost.58581 > localhost.smtp: . ack 45 win 8192 
> <nop,nop,timestamp 781697075 781697075>
> 23:52:45.409452 IP localhost.58581 > localhost.smtp: P 17:46(29) ack 45 win 
> 8192 <nop,nop,timestamp 781702040 781697075>
> 23:52:45.428311 IP localhost.smtp > localhost.58581: P 45:53(8) ack 46 win 
> 8192 <nop,nop,timestamp 781702059 781702040>
> 23:52:45.428350 IP localhost.58581 > localhost.smtp: . ack 53 win 8192 
> <nop,nop,timestamp 781702059 781702059>
> 23:52:48.827722 IP localhost.58581 > localhost.smtp: P 46:84(38) ack 53 win 
> 8192 <nop,nop,timestamp 781705459 781702059>
> 23:52:48.849059 IP localhost.smtp > localhost.58581: P 53:61(8) ack 84 win 
> 8192 <nop,nop,timestamp 781705480 781705459>
> 23:52:48.849098 IP localhost.58581 > localhost.smtp: . ack 61 win 8192 
> <nop,nop,timestamp 781705480 781705480>
> 23:52:50.793324 IP localhost.58581 > localhost.smtp: P 84:90(6) ack 61 win 
> 8192 <nop,nop,timestamp 781707424 781705480>
> 23:52:50.793754 IP localhost.smtp > localhost.58581: P 61:98(37) ack 90 win 
> 8192 <nop,nop,timestamp 781707425 781707424>
> 23:52:50.793788 IP localhost.58581 > localhost.smtp: . ack 98 win 8192 
> <nop,nop,timestamp 781707425 781707425>
> 23:52:54.796060 IP localhost.58581 > localhost.smtp: P 90:113(23) ack 98 win 
> 8192 <nop,nop,timestamp 781711428 781707425>
> 23:52:54.835716 IP localhost.smtp > localhost.58581: . ack 113 win 8192 
> <nop,nop,timestamp 781711468 781711428>
> 23:52:55.112281 IP localhost.58581 > localhost.smtp: P 113:115(2) ack 98 win 
> 8192 <nop,nop,timestamp 781711744 781711468>
> 23:52:55.112314 IP localhost.smtp > localhost.58581: . ack 115 win 8192 
> <nop,nop,timestamp 781711744 781711744>
> 23:52:58.782597 IP localhost.58581 > localhost.smtp: P 115:121(6) ack 98 win 
> 8192 <nop,nop,timestamp 781715415 781711744>
> 23:52:58.782629 IP localhost.smtp > localhost.58581: . ack 121 win 8192 
> <nop,nop,timestamp 781715415 781715415>
> 23:52:59.314239 IP localhost.58581 > localhost.smtp: P 121:124(3) ack 98 win 
> 8192 <nop,nop,timestamp 781715947 781715415>
> 23:52:59.314269 IP localhost.smtp > localhost.58581: . ack 124 win 8192 
> <nop,nop,timestamp 781715947 781715947>
> 23:52:59.323521 IP localhost.smtp > localhost.58581: P 98:128(30) ack 124 win 
> 8192 <nop,nop,timestamp 781715956 781715947>
> 23:52:59.323555 IP localhost.58581 > localhost.smtp: . ack 128 win 8192 
> <nop,nop,timestamp 781715956 781715956>
> 23:53:00.755853 IP localhost.58581 > localhost.smtp: P 124:130(6) ack 128 win 
> 8192 <nop,nop,timestamp 781717389 781715956>
> 23:53:00.756113 IP localhost.smtp > localhost.58581: P 128:137(9) ack 130 win 
> 8192 <nop,nop,timestamp 781717389 781717389>
> 23:53:00.756144 IP localhost.58581 > localhost.smtp: . ack 137 win 8192 
> <nop,nop,timestamp 781717389 781717389>
> 23:53:00.756361 IP localhost.smtp > localhost.58581: F 137:137(0) ack 130 win 
> 8192 <nop,nop,timestamp 781717389 781717389>
> 23:53:00.757265 IP localhost.58581 > localhost.smtp: F 130:130(0) ack 138 win 
> 8192 <nop,nop,timestamp 781717390 781717389>
> 23:53:00.757302 IP localhost.smtp > localhost.58581: . ack 131 win 8192 
> <nop,nop,timestamp 781717390 781717390>
> 
> -- 
> Great spirits have always encountered violent opposition from mediocre minds. 
>         - Albert Einstein
> _______________________________________________
> CLUE-tech mailing list
> CLUE-tech at cluedenver.org
> http://cluedenver.org/mailman/listinfo/clue-tech
> 

_______________________________________________
CLUE-tech mailing list
CLUE-tech at cluedenver.org
http://cluedenver.org/mailman/listinfo/clue-tech



More information about the clue-tech mailing list