]> granicus.if.org Git - python/commitdiff
Patch #1075928: AUTH PLAIN in smtplib.
authorJohannes Gijsbers <jlg@dds.nl>
Mon, 6 Dec 2004 21:25:26 +0000 (21:25 +0000)
committerJohannes Gijsbers <jlg@dds.nl>
Mon, 6 Dec 2004 21:25:26 +0000 (21:25 +0000)
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.

Lib/smtplib.py

index 2e124838850f0bac1979257343540bbf4c3a8012..368aa8dc6a09398b4a29dcd83e998eb563b9d937 100755 (executable)
@@ -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"