This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: SMTP.login() uses invalid base64 enc.
Type: Stage:
Components: Extension Modules Versions: Python 2.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ghaering Nosy List: ghaering, nnorwitz, ondrass
Priority: normal Keywords:

Created on 2002-09-18 11:52 by ondrass, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Messages (4)
msg12443 - (view) Author: Ondrej Sury (ondrass) Date: 2002-09-18 11:52
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)')
msg12444 - (view) Author: Gerhard Häring (ghaering) * (Python committer) Date: 2002-10-14 16:04
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 :-)
msg12445 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-02-07 22:11
Logged In: YES 
user_id=33168

Gerhard, can this be closed now?
msg12446 - (view) Author: Gerhard Häring (ghaering) * (Python committer) Date: 2003-02-07 23:27
Logged In: YES 
user_id=163326

Sure. Done.
History
Date User Action Args
2022-04-10 16:05:41adminsetgithub: 37193
2002-09-18 11:52:39ondrasscreate