[3.13] gh-143921: Reject NUL, CR and LF in IMAP commands (GH-143922, GH-153067) (GH-153137) (GH-153287)
Combined backport of GH-143922, which rejected all control characters,
and GH-153067, which narrowed the check to NUL, CR and LF. Other
control characters are valid in quoted strings and are sent quoted.
(cherry picked from commit
6262704b134db2a4ba12e85ecfbd968534f28b45)
(cherry picked from commit
d0921efb665aff26b378f495e5ff84f7e3fe649d)
(cherry picked from commit
298182272a740ce2016aee2f54acbd0bba1944c1)
Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>