Subject: Re: bug#51733: 27.1; Detect impossible email addresses better

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 19 Jan 2022 14:06:56 +0100

Eli Zaretskii <[email-masked]> writes:

>> There's no scanning -- rmail displays the From header, right?  So it
>> does decoding before displaying the header.  It has to do the textsec
>> stuff first, too.
>
> Not if textsec is optional, it doesn't.

I don't understand what you mean here.  rmail will call
(decorate-suspicious-email from) and then insert the result into the
buffer.  If textsec is switched off, it'll just return `from' as is.

> And I think your mental model of how Rmail presents the email in the
> reading buffer is not accurate.

Here's what it does today:

	  ;; Decode any RFC2047 encoded message headers.
	  (if rmail-enable-mime
	      (with-current-buffer rmail-view-buffer
		(rfc2047-decode-region
		 (point-min)
		 (progn
		   (search-forward "\n\n" nil 'move)
		   (point))))))

It'll just have to call

(insert (rfc2047-decode-string (decorate-suspicious-email (substring ...))))

instead.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no