Skip to content

Smtp auth login should fail immediately if error is bad authentication #100331

Description

@gpatel-fr

Bug report

when using smtplib.SMTP.login, library is using different authentication schemes if available: cram-md5, plain, login
when cram-md5 fails with bad password (smtp error code 535), there is no point in trying plain and login.
Also when server is behind a proxy doing ssl termination, plain and login may fail with a different failure mode:
unprotected password needs ssl mode
leading to confusion on what the real problem is.

Your environment

  • CPython versions tested on: conda python 3.9 (concerned code is identical on trunk)
  • Operating system and architecture: Ubuntu 22.04

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-emailtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions