[3.14] gh-143921: Reject NUL, CR and LF in IMAP commands (GH-143922, GH-153067) (GH-153137)
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)
Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>