[Python-bugs-list] [ python-Bugs-581165 ] smtplib.SMTP.ehlo method esmtp_features

noreply@sourceforge.net noreply@sourceforge.net
Wed, 24 Jul 2002 04:26:24 -0700


Bugs item #581165, was opened at 2002-07-14 09:46
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=581165&group_id=5470

Category: Python Library
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Piers Lauder (pierslauder)
Assigned to: Nobody/Anonymous (nobody)
Summary: smtplib.SMTP.ehlo method esmtp_features 

Initial Comment:
The ehlo() method in the smtplib class SMTP appears to
incorrectly
handle the response from Eudora Internet Mail Server
3.1.3 .

The rsponse to the "EHLO" command is:

send: 'ehlo gemini.cs.usyd.edu.au\r\n'
reply: '250-webfactory.com.au hello
gemini.cs.usyd.edu.au (129.78.111.139)\r\n'
reply: '250-EXPN\r\n'
reply: '250-PIPELINING\r\n'
reply: '250-8BITMIME\r\n'
reply: '250-BINARYMIME\r\n'
reply: '250-CHUNKING\r\n'
reply: '250-ENHANCEDSTATUSCODES\r\n'
reply: '250-ETRN\r\n'
reply: '250-AUTH CRAM-MD5 NTLM PLAIN LOGIN\r\n'
reply: '250-AUTH=LOGIN\r\n'
reply: '250 SIZE 2147483647\r\n'

which is then gathered into:

 ['webfactory.com.au hello gemini.cs.usyd.edu.au
(129.78.111.139)', 'EXPN', 'PIPELINING', '8BITMIME',
'BINARYMIME', 'CHUNKING', 'ENHANCEDSTATUSCODES',
'ETRN', 'AUTH CRAM-MD5 NTLM PLAIN LOGIN', 'AUTH=LOGIN',
'SIZE 2147483647']

which is then parsed into "self.esmtp_features as:

 {'enhancedstatuscodes': '', '8bitmime': '', 'expn':
'', 'chunking': '', 'etrn': '', 'pipelining': '',
'size': '2147483647', 'auth': '=LOGIN', 'binarymime': ''}

Note that the two lines starting "AUTH" have been
elided into the
one dictionary element 'auth':'=LOGIN'.

This prevents a subsequent call to the login() method
from correctly
identifying a suitable authentication method resulting in:

    raise SMTPException("No suitable authentication
method found.")



----------------------------------------------------------------------

>Comment By: Piers Lauder (pierslauder)
Date: 2002-07-24 21:26

Message:
Logged In: YES 
user_id=196212

I tried the patch.

It gets me further - I now get "Syntax Error, not using
<cr><lf> as end of line."

Here's the trace:

resp: ['webfactory.com.au hello gemini.cs.usyd.edu.au
(129.78.111.139)', 'EXPN', 'PIPELINING', '8BITMIME',
'BINARYMIME', 'CHUNKING', 'ENHANCEDSTATUSCODES', 'ETRN',
'AUTH CRAM-MD5 NTLM PLAIN LOGIN', 'AUTH=LOGIN', 'SIZE
2147483647']
features: {'auth=login': '', 'enhancedstatuscodes': '',
'8bitmime': '', 'expn': '', 'chunking': '', 'etrn': '',
'pipelining': '', 'size': '2147483647', 'auth': 'CRAM-MD5
NTLM PLAIN LOGIN', 'binarymime': ''}
send: 'AUTH CRAM-MD5\r\n'
reply: '334
PDExODQ1NzY3NTctNjk3MjgzMDhAd2ViZmFjdG9yeS5jb20uYXU+\r\n'
reply: retcode (334); Msg:
PDExODQ1NzY3NTctNjk3MjgzMDhAd2ViZmFjdG9yeS5jb20uYXU+
send:
'cGllcnMlY29tbXVuaXR5c29sdXRpb25zLmNvbS5hdSAzOTU2NzVmYWUwZGUxZmQyN2I3MTRjNGQ5\nYzgzOWIwNQ==\r\n'
reply: '500 Syntax error, not using <cr><lf> as end of line\r\n'
reply: retcode (500); Msg: Syntax error, not using <cr><lf>
as end of line


Which doesn't make any sense, and is probably a server
problem, since I can see that each line sent _is_ terminated
with <cr><lf>.

So I consider the patch a (qualified) success.


----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2002-07-24 08:00

Message:
Logged In: YES 
user_id=21627

Can you please try the patch in

http://sourceforge.net/tracker/index.php?
func=detail&aid=572031&group_id=5470&atid=305470

and report whether it solves this problem?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=581165&group_id=5470