mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Email: Fix bug when connecting to SMTP relays that use MD5 auth
This commit is contained in:
parent
4e93f9d761
commit
492fb4c526
@ -554,6 +554,8 @@ class SMTP:
|
||||
|
||||
def encode_cram_md5(challenge, user, password):
|
||||
challenge = base64.decodestring(challenge)
|
||||
if isinstance(password, unicode): # Added by Kovid, see http://bugs.python.org/issue5285
|
||||
password = password.encode('utf-8')
|
||||
response = user + " " + hmac.HMAC(password, challenge).hexdigest()
|
||||
return encode_base64(response, eol="")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user