smtplib email example should contain a "Date" header #107809
Labels
3.11
only security fixes
3.12
bugs and security fixes
3.13
new features, bugs and security fixes
docs
Documentation in the Doc dir
topic-email
Documentation
https://docs.python.org/3/library/email.examples.html#email-examples is providing code examples.
But those are 'incorrect' as they miss the "Date" header.
Without it, the mail recipient server will reject the email (Amavis/SpamAssassin is dropping the email due to a 'BAD-HEADER-0' error. I experienced that with : https://docker-mailserver.github.io/docker-mailserver/latest/ )
Related topic:
The correct headers in the examples should be:
I understand it's not "added automatically" but the examples could contain that. So a user can get it right the first time without wondering why emails are not received without any error as only the mail receiver server log would tell...
Linked PRs
The text was updated successfully, but these errors were encountered: