-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
smtplib Sends Commands in Lower-Case #65495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It has occurred to me while testing an SMTP server with smtplib that it sends commands in lower-case. This is problematic because, although most SMTP servers seem to be case-insensitive, RFC 5321 (SMTP) doesn't seem to explicitly require this and there may be systems out there which require upper-case commands. Additionally, the output just looks unclean because the parameters are given capitalized (e.g. we get "mail FROM:<guy@example.com>" instead of "MAIL FROM:<guy@example.com>" or "mail from:<guy@example.com>". I would propose that putcmd() use cmd.upper(). Alternatively, all instances of putcmd() and docmd() could be updated to have the commands in capitalized form so that, should the user desire, they could send lower-case commands, though I don't quite see what would be useful about that. |
Apologies, I was tired when I looked into this. It turns out that SMTP is explicitly case-insensitive with command names. I still think it'd be nice to use upper-case commands for consistency with the FROM: and TO: lines, though, or to put the FROM: and TO: lines in lower-case. |
Fixed for 3.13. Thanks! ✨ 🍰 ✨ |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
mail from
andrcpt to
insmtplib.SMTP
#107019The text was updated successfully, but these errors were encountered: