all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#20133: 24.4; message-mode signs mails multiple times for FCC
@ 2015-03-18 11:41 Moritz Ulrich
  2016-01-20  4:11 ` bug#20133: bug #20133: emacs " Daniel Kahn Gillmor
  2019-09-23  9:47 ` bug#20133: " Lars Ingebrigtsen
  0 siblings, 2 replies; 3+ messages in thread
From: Moritz Ulrich @ 2015-03-18 11:41 UTC (permalink / raw)
  To: 20133


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.

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

A failure when typing the passphrase a second time results in message
failing to store a local copy of the mail, even when the mail was sent
successfully. This can be confusing.

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?

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



In GNU Emacs 24.4.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.25)
 of 2015-02-20 on localhost
Windowing system distributor `The X.Org Foundation', version 11.0.11604000
Configured using:
 `configure --disable-dependency-tracking
 --prefix=/nix/store/ji06y4haijly0i0knmr986l2dajffv1p-emacs-24.4
 --with-x-toolkit=gtk --with-xft'

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Message

Minor modes in effect:
  mml-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  auto-fill-function: message-do-auto-fill
  transient-mark-mode: t
  abbrev-mode: t

Recent input:
C-x m m o r i t z @ t r <backspace> a r n - v e d r 
a . d e C-j C-/ C-n t e s t C-j F C C : S-SPC / h o 
m e / m o r i t z / <M-backspace> <M-backspace> t m 
p / C-n C-n C-e C-j C-j M-x m m l <XF86Tools> - <tab> 
<tab> s e <tab> e <tab> <M-backspace> <tab> i <backspace> 
s i <tab> <tab> - p g <tab> m <tab> <return> C-/ M-x 
m m <tab> l - s e <tab> <M-backspace> m e <tab> <tab> 
<M-backspace> s <tab> m <tab> <tab> s i <tab> - <tab> 
m <backspace> p <backspace> p g p m <tab> <return> 
C-c C-c t r <tab> <return> M-x C-g M-x r e p o r t 
a <backspace> - e m <tab> <return>

Recent messages:
Undo!
Making completion list... [3 times]
You can run the command `mml-secure-message-sign-pgpmime' with C-c RET s p
Mark set
Sending...
Mark set [2 times]
Sending via mail...
Setting `send-mail-function' temporarily since "emacs -q" would overwrite customizations
Mark set
mail-file-babyl-p: not a regular file: /tmp/
Quit

Load-path shadows:
/run/current-system/sw/share/emacs/site-lisp/site-start hides /nix/store/ji06y4haijly0i0knmr986l2dajffv1p-emacs-24.4/share/emacs/site-lisp/site-start

Features:
(shadow emacsbug mailalias cus-edit cus-start cus-load sendmail epg gnus
gnus-ems nnheader wid-edit cl-loaddefs cl-lib mml2015 epg-config
password-cache mail-extr sort help-mode gnus-util message format-spec
rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr
mailabbrev mail-utils gmm-utils mailheader time-date tooltip electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 16 108724 11604)
 (symbols 48 20876 0)
 (miscs 40 111 160)
 (strings 32 17949 4123)
 (string-bytes 1 517079)
 (vectors 16 12380)
 (vector-slots 8 415807 7630)
 (floats 8 81 276)
 (intervals 56 381 20)
 (buffers 960 17)
 (heap 1024 29049 684))





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#20133: bug #20133: emacs 24.4; message-mode signs mails multiple times for FCC
  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
  2019-09-23  9:47 ` bug#20133: " Lars Ingebrigtsen
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Kahn Gillmor @ 2016-01-20  4:11 UTC (permalink / raw)
  To: Moritz Ulrich, 20133

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#20133: 24.4; message-mode signs mails multiple times for FCC
  2015-03-18 11:41 bug#20133: 24.4; message-mode signs mails multiple times for FCC Moritz Ulrich
  2016-01-20  4:11 ` bug#20133: bug #20133: emacs " Daniel Kahn Gillmor
@ 2019-09-23  9:47 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-23  9:47 UTC (permalink / raw)
  To: Moritz Ulrich; +Cc: 20133

Moritz Ulrich <moritz@tarn-vedra.de> writes:

> 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.

This should now be fixed in Emacs 27.

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-23  9:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-18 11:41 bug#20133: 24.4; message-mode signs mails multiple times for FCC Moritz Ulrich
2016-01-20  4:11 ` bug#20133: bug #20133: emacs " Daniel Kahn Gillmor
2019-09-23  9:47 ` bug#20133: " Lars Ingebrigtsen

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.