Issue 611052: SMTP.login() uses invalid base64 enc. (original) (raw)

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 "", 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)')