diff options
author | Eli Zaretskii <eliz@gnu.org> | 2020-12-26 12:35:34 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2020-12-26 12:35:34 +0200 |
commit | c15672376943ae6bfe05f3ab91f5b8a65a9d8d4a (patch) | |
tree | 11856accecc842f76175282b0f70e63ffa10a69d /lisp/mail/rmailsum.el | |
parent | b242bbb073b501f7a4d4569c2d70cde522abbea3 (diff) | |
download | emacs-c15672376943ae6bfe05f3ab91f5b8a65a9d8d4a.tar.gz |
Fix Rmail summary display when From: header is malformed
* lisp/mail/rmailsum.el (rmail-header-summary): Remove newlines
from the "From:" value, to avoid producing corrupted summary
display.
Diffstat (limited to 'lisp/mail/rmailsum.el')
-rw-r--r-- | lisp/mail/rmailsum.el | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index cc55451902a..2eda3222a47 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -786,6 +786,11 @@ the message being processed." ;; To: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= ;; <stepnem@gmail.com> (setq from (rfc2047-decode-string from)) + ;; We cannot tolerate any leftover newlines in From, + ;; as that disrupts the rmail-summary display. + ;; Newlines can be left in From if it was malformed, + ;; e.g. had unbalanced quotes. + (setq from (replace-regexp-in-string "\n+" " " from)) (setq len (length from)) (setq mch (string-match "[@%]" from)) (format "%25s" |