mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-139434: Update selected RFC 2822 references to RFC 5322 (#139435)
Update selected RFC 2822 references to RFC 5322 RFC 2822 was obsoleted by RFC 5322 in 2008. This updates references to use the current standard in documentation, docstrings, and comments. It preserves RFC 2822 references in legacy API components to maintain their historical context. RFC 822 → RFC 2822 → RFC 5322 progression is explained where relevant. In some places specific sections of RFC are referenced where it seems helpful. Scout rule was applied in some places and RFC mentions format was normalized in doc strings and comments.
This commit is contained in:
parent
97d8dda980
commit
ce1bb85d28
15 changed files with 49 additions and 45 deletions
|
|
@ -917,7 +917,7 @@ def send_message(self, msg, from_addr=None, to_addrs=None,
|
|||
The arguments are as for sendmail, except that msg is an
|
||||
email.message.Message object. If from_addr is None or to_addrs is
|
||||
None, these arguments are taken from the headers of the Message as
|
||||
described in RFC 2822 (a ValueError is raised if there is more than
|
||||
described in RFC 5322 (a ValueError is raised if there is more than
|
||||
one set of 'Resent-' headers). Regardless of the values of from_addr and
|
||||
to_addr, any Bcc field (or Resent-Bcc field, when the Message is a
|
||||
resent) of the Message object won't be transmitted. The Message
|
||||
|
|
@ -931,7 +931,7 @@ def send_message(self, msg, from_addr=None, to_addrs=None,
|
|||
policy.
|
||||
|
||||
"""
|
||||
# 'Resent-Date' is a mandatory field if the Message is resent (RFC 2822
|
||||
# 'Resent-Date' is a mandatory field if the Message is resent (RFC 5322
|
||||
# Section 3.6.6). In such a case, we use the 'Resent-*' fields. However,
|
||||
# if there is more than one 'Resent-' block there's no way to
|
||||
# unambiguously determine which one is the most recent in all cases,
|
||||
|
|
@ -950,7 +950,7 @@ def send_message(self, msg, from_addr=None, to_addrs=None,
|
|||
else:
|
||||
raise ValueError("message has more than one 'Resent-' header block")
|
||||
if from_addr is None:
|
||||
# Prefer the sender field per RFC 2822:3.6.2.
|
||||
# Prefer the sender field per RFC 5322 section 3.6.2.
|
||||
from_addr = (msg[header_prefix + 'Sender']
|
||||
if (header_prefix + 'Sender') in msg
|
||||
else msg[header_prefix + 'From'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue