[Python-bugs-list] [ python-Bugs-611052 ] SMTP.login() uses invalid base64 enc.

SourceForge.net noreply@sourceforge.net
Fri, 07 Feb 2003 14:11:28 -0800


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

Category: Extension Modules
Group: Python 2.2.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Ondrej Sury (ondrass)
>Assigned to: Gerhard Häring (ghaering)
Summary: SMTP.login() uses invalid base64 enc.

Initial Comment:
If you have veeery long username and/or password it encodes
it with '\n' after 80? characters.  This violates
(IMHO) smtp standard.
In following example look for \n characters.

O.

>>> from smtplib import SMTP
>>> s = SMTP('smtp.servery.cz')
>>> s.set_debuglevel(255)
>>>
s.login('veeeery.looooong.username@veeeeery.loooooong.domain',
'veeeeery.loooong.password')
send: 'ehlo shade.globe.cz\r\n'
reply: '250-smtp.cz\r\n'
reply: '250-AUTH LOGIN PLAIN\r\n'
reply: '250-AUTH=LOGIN PLAIN\r\n'
reply: '250-PIPELINING\r\n'
reply: '250-STARTTLS\r\n'
reply: '250 8BITMIME\r\n'
reply: retcode (250); Msg: smtp.cz
AUTH LOGIN PLAIN
AUTH=LOGIN PLAIN
PIPELINING
STARTTLS
8BITMIME
AuthMethod: PLAIN
send: 'AUTH PLAIN
dmVlZWVyeS5sb29vb29uZy51c2VybmFtZUB2ZWVlZWVyeS5sb29vb29vbmcuZG9tYWluAHZlZWVl\ncnkubG9vb29vbmcudXNlcm5hbWVAdmVlZWVlcnkubG9vb29vb25nLmRvbWFpbgB2ZWVlZWVyeS5s\nb29vb25nLnBhc3N3b3Jk\r\n'
reply: '501 malformed auth input (#5.5.4)\r\n'
reply: retcode (501); Msg: malformed auth input (#5.5.4)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.2/smtplib.py", line 546, in login
    raise SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (501, 'malformed auth
input (#5.5.4)')


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

>Comment By: Neal Norwitz (nnorwitz)
Date: 2003-02-07 17:11

Message:
Logged In: YES 
user_id=33168

Gerhard, can this be closed now?

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

Comment By: Gerhard Häring (ghaering)
Date: 2002-10-14 12:04

Message:
Logged In: YES 
user_id=163326

Thanks for the bug report. This has already been fixed in
Python 2.3-CVS and the 2.2 maintenance branch. So just
upgrade to Python 2.2.2 when it'll be out tomorrow :-)

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

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