all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
To: Moritz Ulrich <moritz@tarn-vedra.de>, 20133@debbugs.gnu.org
Subject: bug#20133: bug #20133: emacs 24.4; message-mode signs mails multiple times for FCC
Date: Tue, 19 Jan 2016 23:11:55 -0500	[thread overview]
Message-ID: <87bn8g7uus.fsf@alice.fifthhorseman.net> (raw)
In-Reply-To: <87wq2elehd.fsf@moritz-x230.i-did-not-set--mail-host-address--so-tickle-me>

[-- Attachment #1: Type: text/plain, Size: 3110 bytes --]

On Wed 2015-03-18 07:41:34 -0400, on https://debbugs.gnu.org/20133, Moritz Ulrich wrote:
> When sending signed emails with `mml-secure-message-sign-pgpmime', GnuPG
> is called once for the outgoing mail, then again for every FCC: header
> field.

I can confirm this for emacs 24.5 as well as the original report's 24.4.

> This isn't problematic when using gpg-agent & caching of
> passphrases, very annoying when not.

It's also problematic when using a smartcard, or when using
ignore-cache-for-signing in ~/.gnupg/gpg-agent.

Even when not using signatures and just encrypting, it's a bad situation
because the body of the message stored in fcc is different from the body
of the message sent into the SMTP network.

This is also a concern if you have options set like
message-generate-hashcash, because then the hashcash information sent
via mail doesn't get copied into the fcc.  Similarly, users with
message-send-mail-partially-limit will see the whole message in Fcc, and
won't be able to tell that it was split upon sending.

I also find this troubling because the documentation explicitly
contemplates the use of message-mode's encryption and signing with Fcc
without acknowledging this flaw:

 https://www.gnu.org/software/emacs/manual/html_node/mh-e/Sending-PGP.html

> The issue tracks down to message.el:5411 where
> `message-encode-message-body' is called in a loop for every FCC.
>
> I'm not sure why it's necessary to re-encode the message once for every
> FCC. Isn't it possible to just store the original outgoing mail?

I think this is the right default -- though i think it won't work for
users who have set message-fcc-externalize-attachments to non-nil.

The raw message created and sent via message-send, which might itself
operate multiple times, since message-send-alist by default is:

 ((news message-news-p message-send-via-news)
  (mail message-mail-p message-send-via-mail))

message-news-p and message-mail-p are defined to be mutually-exclusive,
but i don't think the code in message-send would require them to be.

And neither one of them returns or sets aside a buffer with the message
to be stored either.

Perhaps fcc would be better implemented as some sort of hook in
message-send-mail-hook or message-send-hook or message-sent-hook
instead?  Is there a way to get this buffer?

My elisp is not good enough to produce a patch without breaking things
that other people might rely on if i try it by myself.  But if someone
wants to give me pointers for where to start i can try to produce
something useful.

> If not, I suggest adding a variable to prevent signing from happening
> when storing the mail locally. 

I don't think this approach would be the right approach.  The user
should know whether a given mail was sent out signed or not.  The user
should also be able to expect that the octets in the fcc'ed body are the
same bytes that were sent to the network.

Please Cc me on followups to 20133, it's not clear how i should
subscribe to this installation of debbugs.

Regards,

        --dkg

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 948 bytes --]

  reply	other threads:[~2016-01-20  4:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-18 11:41 bug#20133: 24.4; message-mode signs mails multiple times for FCC Moritz Ulrich
2016-01-20  4:11 ` Daniel Kahn Gillmor [this message]
2019-09-23  9:47 ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bn8g7uus.fsf@alice.fifthhorseman.net \
    --to=dkg@fifthhorseman.net \
    --cc=20133@debbugs.gnu.org \
    --cc=moritz@tarn-vedra.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.