[issue27820] Possible bug in smtplib when initial_response_ok=False
junpengruan <632077...@qq.com> added the comment: Hi I think there is another bug when initial_response_ok=False. When using AUTH PLAIN, the server will response like: -- C: AUTH PLAIN S: 334 ok. go on -- and it's not base64 encoding, while in the auth() it will decode the resp(here is "ok, go on") which will cause a binascii.Error: Traceback (most recent call last): File "/usr/lib/python3.6/smtplib.py", line 644, in auth challenge = base64.decodebytes(resp) File "/usr/lib/python3.6/base64.py", line 553, in decodebytes return binascii.a2b_base64(s) binascii.Error: Incorrect padding I think this fit the title "a bug in smtplib when initial_response_ok=False", should I just comment on this issue or open a new issue? Thanks! -- nosy: +junpengruan ___ Python tracker <https://bugs.python.org/issue27820> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43949] binascii.Error raised in smtplib when initial_response_ok=False
New submission from junpengruan <632077...@qq.com>: Hi I think there is a bug when initial_response_ok=False and using AUTH PLAIN, the server will response like: -- C: AUTH PLAIN S: 334 ok. go on -- and it's not base64 encoding, while in the auth() it will base64 decode the resp(here is "ok, go on") which will cause a binascii.Error: Traceback (most recent call last): File "/usr/lib/python3.6/smtplib.py", line 644, in auth challenge = base64.decodebytes(resp) File "/usr/lib/python3.6/base64.py", line 553, in decodebytes return binascii.a2b_base64(s) binascii.Error: Incorrect padding I am using Magic Winmail Server2.4(build 0530) as a SMTP server, which appears dont support initial_response, so I set initial_response_ok=False and got this Error. currently I catch this error and ignore it to evade program failed, it works fine. Is there better way to fix this problem? Thanks! -- components: email messages: 392039 nosy: barry, junpengruan, r.david.murray priority: normal severity: normal status: open title: binascii.Error raised in smtplib when initial_response_ok=False type: behavior versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue43949> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43949] binascii.Error raised in smtplib when initial_response_ok=False
junpengruan <632077...@qq.com> added the comment: Hi Pandu, thanks for your reply! I have read the RFC4954 you mentioned and agree that the server shouldn't react like this. Then I notice that this RFC's publication date is 2007 and the server I use is published in 2003, that's maybe the reson why I meet this problem, Maybe I should just evade this problem for my own program and close this bug? -- ___ Python tracker <https://bugs.python.org/issue43949> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com