From: Johannes Gijsbers Date: Mon, 6 Dec 2004 21:25:26 +0000 (+0000) Subject: Patch #1075928: AUTH PLAIN in smtplib. X-Git-Tag: v2.5a0~2287 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=25946ddac90e2f69199af740cbaaa08beb13d9a9;p=python Patch #1075928: AUTH PLAIN in smtplib. smtplib can not log in to some server using command AUTH PLAIN, it sends ``user\0user\0pass'' to the server, but ``\0user\0pass'' has better compatibility. --- diff --git a/Lib/smtplib.py b/Lib/smtplib.py index 2e12483885..368aa8dc6a 100755 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -530,7 +530,7 @@ class SMTP: return encode_base64(response, eol="") def encode_plain(user, password): - return encode_base64("%s\0%s\0%s" % (user, user, password), eol="") + return encode_base64("\0%s\0%s" % (user, password), eol="") AUTH_PLAIN = "PLAIN"