Title: smtplib AUTH command doesn't handle EAI arguments
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.9, Python 3.8, Python 3.7, Python 3.6
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: jrlevine
Priority: normal Keywords: patch

Created on 2021-05-30 19:25 by jrlevine, last changed 2021-06-13 17:28 by jrlevine.

Pull Requests
URL Status Linked Edit
PR 26709 open jrlevine, 2021-06-13 17:28
Messages (1)
msg394779 - (view) Author: John L (jrlevine) * Date: 2021-05-30 19:25
In an EAI (SMTPUTF8) mail session, AUTH usernames and passwords can be UTF-8, not just ASCII.

The fix is easy.  In, in three places in the auth() and auth_cram_md5() routines change ".encode('ascii')" to ".encode(self.command_encoding)"

I have tried this with EAI mail servers in India and China to be sure it works.
Date User Action Args
2021-06-13 17:28:41jrlevinesetkeywords: + patch
stage: patch review
pull_requests: + pull_request25299
2021-05-30 19:25:20jrlevinecreate