class SMTP:
def auth_login(self, challenge=None):
The self.docmd should use cmd "AUTH" with parameter "LOGIN" + encoded login like
(code, resp) = self.docmd("AUTH", "LOGIN " +
encode_base64(self.user.encode('ascii'), eol=''))
with
def auth(self, mechanism, authobject, *, initial_response_ok=True):
that should not send a "AUTH" in self.docmd in case the mechanism is 'LOGIN' and
if initial_response is not None:
meaning
if mechanism == 'LOGIN':
(code, resp) = self.docmd(response)
else:
(code, resp) = self.docmd("AUTH", mechanism + " " + response)
---
Could someone kindly review, evtly come up with better suggestion?
In short:
$ diff /c/Python35/Lib/smtplib-old.py /c/Python35/Lib/smtplib.py
630c630,633
< (code, resp) = self.docmd("AUTH", mechanism + " " + response)
---
> if mechanism == 'LOGIN':
> (code, resp) = self.docmd(response)
> else:
> (code, resp) = self.docmd("AUTH", mechanism + " " + response)
660c663
< (code, resp) = self.docmd(
---
> (code, resp) = self.docmd("AUTH", "LOGIN " + |