diff --git a/Lib/smtplib.py b/Lib/smtplib.py index b71fee8777e866..808f0fd47e8b4e 100644 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -734,6 +734,7 @@ def login(self, user, password, *, initial_response_ok=True): preferred_auths = ['CRAM-MD5', 'PLAIN', 'LOGIN'] else: preferred_auths = ['PLAIN', 'LOGIN'] + # We try the supported authentications in our preferred order, if # the server supports them. authlist = [auth for auth in preferred_auths if auth in advertised_authlist]