Bug 61466 - smtp connection fails if STMP server returns muti-line greeting
Summary: smtp connection fails if STMP server returns muti-line greeting
Status: RESOLVED WORKSFORME
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: smtp (show other bugs)
Version: unspecified
Platform: RedHat Enterprise Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Marc Mutz
URL:
Keywords:
: 62477 72955 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-07-20 19:17 UTC by Denis Moinel
Modified: 2004-01-19 19:07 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
ethereal capture (25.29 KB, application/octet-stream)
2003-08-31 14:29 UTC, Denis Moinel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Moinel 2003-07-20 19:17:52 UTC
Version:           KMAIL1.5 (using KDE KDE 3.1.1)
Installed from:    RedHat RPMs
OS:          Linux

Hello!
When kmail try a smtp connection to a "Merak Mail server", if the server return this:
220-mail.BlahBlah.fr ESMTP BlahBlah Mail Server; Sun, 20 Jul 2003 17:42:40 +0100
220-*********************************************************************
220-* BlahBlah Secure Mail Server                                        *
220-*                                                                   *
220-* All connections are logged!                                       *
220-* This server employs anti-virus and antis-pam technology           *
220 *********************************************************************

The smtp connection fail because it check the last line, and not the first.

Thank you for your very good work.

Denis Moinel
Comment 1 Denis Moinel 2003-07-20 19:32:16 UTC
Perhaps the response from the server is in a bad format. The RFC821 doesn't be very precise 
on this multiline format. 
(sorry for my english.) 
 
Comment 2 Thiago Macieira 2003-07-21 21:34:33 UTC
RFC 2821 doesn't clarify much either, but it says that the official domain name 
must be the first word after the 220 code (I'd say it's the first line). The thing is, it 
also lists the Greeting line with "220 " in ABNF. 
Comment 3 Denis Moinel 2003-07-21 23:12:10 UTC
RFC2821 Says this: 
_________________ 
The format for multiline replies requires that every line, except the 
   last, begin with the reply code, followed immediately by a hyphen, 
   "-" (also known as minus), followed by text.  The last line will 
   begin with the reply code, followed immediately by <SP>, optionally 
   some text, and <CRLF>.  As noted above, servers SHOULD send the <SP> 
   if subsequent text is not sent, but clients MUST be prepared for it 
   to be omitted. 
 
   For example: 
 
      123-First line 
      123-Second line 
      123-234 text beginning with numbers 
      123 The last line 
 
   In many cases the SMTP client then simply needs to search for a line 
   beginning with the reply code followed by <SP> or <CRLF> and ignore 
   all preceding lines.  In a few cases, there is important data for the 
   client in the reply "text".  The client will be able to identify 
   these cases from the current context. 
__________________ 
Others SMTP clients like "MS outlook*, Eudora, The bat..."  work fine in this configuration. 
Comment 4 Thiago Macieira 2003-07-22 01:12:52 UTC
That's why it's confusing. The RFC says there might be a few cases in which 
important data is in the "text". The 220 reply is one of those cases. 
 
But it does not say whether the important data should be in the first line or the one 
with the space (the last). It is my understanding of the RFC that it's the first line. 
Comment 5 Aaron J. Seigo 2003-08-22 19:38:33 UTC
hrm... is the original poster SURE that it is the multiline 220 reply that cuases the 
problem? and if so, what makes you think that? 
 
what is the exact error msg that KMail gives you in the error dialog? 
 
the reason i ask is that looking at the SMTP code in 3.1, it doesn't actually parse the 
220 reply at all. all it does is recv it and then make sure that it starts with a valid 
number. it then immediately goes into the EHLO/HELO exchange.. 
 
would it be possible to get a complete log of the client/server exchange using a tool 
like ethereal or some other (readable) TCP dumper? 
Comment 6 Denis Moinel 2003-08-31 14:29:12 UTC
Created attachment 2340 [details]
ethereal capture

hello. 
When the provider remove the multiline reply, kmail work fine. 
 
I have make others tests: 
The error msg is: Reponse SMTP recue non valable: "*****************" 
you can find in attachement a capture of error message (jpeg) and a complete
ethereal log made with ethereal 0.9.8 
You can also make tests on email testkmail@moinel.org 
smtp server : mail.moinel.org 
pop3 server :mail.moinel.org 
If need, I can give you a valid password for the tests (in private)
Comment 7 Denis Moinel 2003-08-31 14:36:10 UTC
Info: the attachement "ethereal capture" is a tgz archive. 
Comment 8 Marc Mutz 2003-09-24 23:49:25 UTC
Please check with 3.2 alpha. Works for me (which means I can use "check what the server 
supports" in KMail's configure dialog and the result (debug output from the slave) looks kosher. 
Comment 9 Marc Mutz 2003-09-24 23:54:17 UTC
*** Bug 62477 has been marked as a duplicate of this bug. ***
Comment 10 Marc Mutz 2003-10-02 17:34:28 UTC
Works for me. 
Comment 11 Ingo Klöcker 2004-01-19 19:07:30 UTC
*** Bug 72955 has been marked as a duplicate of this bug. ***