Skip to content

Unify all smtplib commands to be uppercase #136191

Open
@MrExcitingDigits

Description

@MrExcitingDigits

Hello,

I know there was a previous issue made years ago about smtplib being inconsistent with uppercase and lowercase commands, however the succeeding fix made the commands lowercase. I think these should be switched to uppercase and here's why:

RFC 5321 states "A few SMTP servers, in violation of this specification (and RFC 821) require that command verbs be encoded by clients in upper case. Implementations MAY wish to employ this encoding to accommodate those servers."

Servers such as Postfix and many others have resolved to simply making all SMTP commands and options uppercase as depicted (though not required) in all the RFC documents. Though it is not strictly necessary, it will have better support (even if marginally) and is a quick fix.

Also, smtplib seems to already send some of these commands and options like STARTTLS and SMTPUTF8 uppercase which technically leaves the inconsistency of the last issue unsolved.

Ultimately, I think it would be best for posterity to simply make all of these uppercase and it should be a quick fix.

I can make the proper edits and make a pull request if there isn't some obvious reason for this I'm missing.

Let me know your thoughts! 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtopic-emailtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions