Unify all smtplib commands to be uppercase · Issue #136191 · python/cpython · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
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

      TMZ Celebrity News – Breaking Stories, Videos & Gossip

      Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

      Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

      🎥 Watch TMZ Live

      TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.