Bug 93544

Summary: SMTP EHLO ignores "send custom hostname to server"
Product: [Unmaintained] kmail Reporter: timbacon
Component: sendingAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: hagemann1, thiago
Priority: NOR    
Version: 1.7.1   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description timbacon 2004-11-19 00:34:21 UTC
Version:           1.7.1 (using KDE 3.3.1,  (3.1))
Compiler:          gcc version 3.3.5 (Debian 1:3.3.5-2)
OS:                Linux (i686) release 2.6.8-1-686

What I see is is:
>Sending failed:
>Unexpected server response to EHLO command. The server responded:
>"Syntactically invalid EHLO argument(s)"

This is because the hostname assigned by my ISP contains hyphens. So I set "send custom hostname to server" (custom hostname without hypens!) in the SMTP transport params. But custom hostname never gets sent to server! (Ethereal trace shows that only "ehlo\r\n" is sent.) 

When I try telnet, "ehlo" without custom hostname fails but "ehlo" with custom hostname succeeds:

<code>
telnet mail.aaa.net smtp
Trying xxx.yyy.zzz.99...
Connected to mail.aaa.net.
Escape character is '^]'.
220 mail.aaa.net Thu, 18 Nov 2004 23:20:39 +0000
ehlo
501 Syntactically invalid EHLO argument(s)
ehlo me.primeeight.co.uk
250-maxio2.uk2net.com Hello me.primeeight.co.uk [nnnn.nnnn.nnnn.nnnn]
250-SIZE 104857600
250-PIPELINING
250-AUTH PLAIN CRAM-MD5 LOGIN
250 HELP
</code>

Perhaps similar to Bug 67797: though not an authorisation problem more a connection problem.

Thanks in advance,

Tim
Comment 1 Kilian Hagemann 2005-05-11 17:15:03 UTC
I can reproduce this exactly, and it's terribly annoying cause I can't send any email. I'm sitting behind a BSD based gateway with SPI/NAT, the public IP of the gateway also having a reverse DNS entry with hyphens in it.

I get the same error message and am able to reproduce the same telnet output using our ISP's smtp server. Setting a custom hostname in the mail transport properties does also not help as it doesn't seem to make a difference (I guess this name is never sent but I didn't verify this).
Comment 2 Kilian Hagemann 2005-05-11 17:17:51 UTC
Forgot to mention my system: Kmail 1.7.2 / KDE 3.3.2 on gentoo linux 2.6.11-gentoo-r4 using gcc-3.3.5.
Comment 3 Thiago Macieira 2005-05-12 06:14:57 UTC
What is the hostname (with hypens) that you are trying to use?
Comment 4 Kilian Hagemann 2005-05-12 09:58:01 UTC
Our ISP assigns our gateway the hostname "wbs-aaa-bb-cc-ddd.wbs.co.za" where aaa.bb.cc.ddd is its public ip address. As far as I understand it does not matter what my client machine is set to due to NATing.

However, I've just tried to telnet our ISP's smtp server again:

telnet smtp.wirelessza.co.za smtp
Trying 196.15.251.88...
Connected to smtp.wirelessza.co.za.
Escape character is '^]'.
220 +OK smtp.wirelessza.co.za Ready (http://www.wirelessza.co.za/)
ehlo
501 Syntactically invalid EHLO argument(s)
ehlo wbs-aaa-bb-cc-ddd.wbs.co.za
250-smtp.wirelessza.co.za Hello wbs-aaa-bb-cc-ddd.wbs.co.za [196.46.70.241]
250-SIZE 8388608
250-PIPELINING
250 HELP

So the ISP assigned hostname seems fine with telnet, but not fine with kmail as I have used many different networks and only on this one did kmail sending bomb out with the above error.

Unfortunately I can don't have a solid grasp of what the problem might be as I don't even understand what EHLO does. Can I try any other diagnostics?
Comment 5 Thiago Macieira 2005-08-15 04:38:13 UTC
Could this bug be the same as bug 85653?
Comment 6 Thiago Macieira 2005-08-15 04:40:19 UTC
Oops, I meant bug 69828.
Comment 7 Thomas McGuire 2007-12-27 18:15:52 UTC
SVN commit 753500 by tmcguire:

Some (attempted) fixes for hostnames:

- When the hostname of the client doesn't include a dot, add
  a fake ".localnet" extension, so the server thinks it is a
  valid hostname

- Don't actually do anything in openConnection(). The connection
  will be opened in put(), where the fake hostname is known.
  This probably fixes
BUG: 93544



 M  +12 -10    smtp.cpp  
 M  +1 -1      smtp.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=753500