Subject: Re: bug#25155: 25.1.90; Gnus: Sending a GnuPG-signed message executes the signing operation twice when using gcc field in the message (annoyance with smartcards)

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 23 Sep 2019 02:16:37 +0200

Teemu Likonen <[email-masked]> writes:

> Would a single sign operation suffice in Gnus? After all, it's just two
> copies of the same message?

Indeed.  But, man, was this difficult to debug, because putting a
`debug' statement into any of the mml functions just didn't work.  It
turns out you had to say

    (let ((inhibit-redisplay nil))
      (debug))

to get it to debug.  (I've now amended the doc string.)

So that took like nine hours, and it turns out that (logically enough)
the second call to the encoding function is done from
`gnus-inews-do-gcc'.  It doesn't really know anything about what may
have happened before -- it just interprets the Gcc header, and then
calls `message-encode-message-body', which will encode the data again.

So to avoid the double encoding, Message needs some way to tell this
function not do to that, but instead cache the encoded value and make
`gnus-inews-do-gcc' use that instead.  Hm...  Perhaps a buffer-local
variable will do the trick...

I think I'll have a look at that tomorrow.

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