From f0031592fd48c4ad32419a3d88c661ccc82c943b Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Thu, 17 Apr 2025 16:08:53 +0200 Subject: [PATCH] Match mail headers case-insensitively when encoding * lisp/mail/rfc2047.el (rfc2047-encode-message-header): Bind 'case-fold-search' to t when looking up the encoding method, otherwise a header spelled "CC" is encoded using the wrong method. (Bug#77866) (cherry picked from commit 7d886f214e165d84d3fdbe14b3766d9e88056529) --- lisp/mail/rfc2047.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/mail/rfc2047.el b/lisp/mail/rfc2047.el index 78a49924b39..5fc53f1db97 100644 --- a/lisp/mail/rfc2047.el +++ b/lisp/mail/rfc2047.el @@ -265,7 +265,8 @@ Should be called narrowed to the head of the message." (if (= (length charsets) 1) (cons (mm-charset-to-coding-system (car charsets)) mm-coding-system-priorities) - mm-coding-system-priorities))) + mm-coding-system-priorities)) + (case-fold-search t)) (while (setq elem (pop alist)) (when (or (and (stringp (car elem)) (looking-at (car elem))) -- 2.39.5