Bug in notmuch-emacs: inconsistent rendering for messages with multiple From: headers

2017-10-22 Thread Daniel Kahn Gillmor
I'm experimenting with e-mail messages with multiple addresses in the
From: line.  i know, it's dirty, but e-mail is a dirty world.

I noticed that notmuch-emacs renders such messages differently depending
on the order of the recipients, and whether or not they are an addr-spec
or a mail-addr (see https://tools.ietf.org/html/rfc5322#section-3.4).

All three messags below are "From:" both alice and bob, and alice is
always listed first.  the difference in how notmuch-emacs displays them
is in how the sending address shows up.  In notmuch-search, it only
shows the first address:

---
 1 mins. ago [1/1]   al...@fifthhorseman.net  a final test ()
 5 mins. ago [1/1]   al...@fifthhorseman.net  a third message ()
23 mins. ago [1/1]   Alicea second test from Alice and Bob ()
24 mins. ago [1/1]   Alicea test from alice and bob ()
End of search results.
---

But the first message in notmuch-show doesn't show Bob at all:
---
Alice  (8 mins. ago) ()
Subject: a test from alice and bob
To: Daniel Kahn Gillmor 
Date: Mon, 23 Oct 2017 01:37:56 -0400

here we go
---
--- Begin Message ---
here we go
--- End Message ---


While the rest of them do:

---
Alice , Bob  (0 mins. ago) ()
Subject: a second test from Alice and Bob
To: Daniel Kahn Gillmor 
Date: Mon, 23 Oct 2017 01:38:43 -0400

how about now?
---
--- Begin Message ---
how about now?
--- End Message ---

---
al...@fifthhorseman.net, Bob  (0 mins. ago) ()
Subject: a third message
To: Daniel Kahn Gillmor 
Date: Mon, 23 Oct 2017 01:56:46 -0400

another try
---
--- Begin Message ---
another try
--- End Message ---

---
al...@fifthhorseman.net, b...@fifthhorseman.net (0 mins. ago) ()
Subject: a final test
To: Daniel Kahn Gillmor 
Date: Mon, 23 Oct 2017 02:00:36 -0400

and where does this leave us?
---
--- Begin Message ---
and where does this leave us?
--- End Message ---


Maybe someone with better emacs-fu could figure out why the first of the
four is different?

 --dkg


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


BUG: emacs: fcc duplicates messages with variant bodies due to mml security

2017-10-22 Thread Daniel Kahn Gillmor
I'm concerned that notmuch-emacs is causing variant messages of
encrypted/signed messages to be generated.

In particular, if notmuch-fcc-dirs is not nil, two variants of the
message bodies will be created: one will be sent through "notmuch
insert" and the other will be sent to sendmail.

the mml security modes (e.g. "#secure method=pgpmime mode=sign" (in
angle brackets)) take place after this bifurcation.

The result for a signed message is:

  * the message sent to "notmuch insert" has one cryptographic signature

  * the message sent to sendmail has a different cryptographic
signature, in particular if it is made more than 1 second later
(some signature algorithms will produce identical signatures if made
in the same second)

You can try this out by:

 0) put ignore-cache-for-signing in ~/.gnupg/gpg-agent.conf

 1) run "gpgconf --kill gpg-agent" to ensure the config is re-read

 2) send yourself a signed message with message-id $mid.
 
 3) Pull it back in however you receive mail, and then:

 diff -u $(notmuch search --output=files "id:$mid")

If the messages were more than 1 second apart, you'll see the signature
part differs.

The result for an encrypted message is:

 * the message sent to "notmuch insert" is encrypted with one session
   key

 * the message sent to sendmail is encrypted with a different session key

So the entire body of the message will be different.

I'm currently working around this by setting notmuch-fcc-dirs to nil,
and setting message-send-mail-hook to (dkg-notmuch-fcc), which is defined
as:

(defun dkg-notmuch-fcc ()
  (shell-command-on-region (point-min) (point-max) "notmuch insert"))

this takes advantage of message-send-mail-hook's late-send.  as the
documentation for that var says:

This hook is run very late -- just before the message is sent as
mail.

But this isn't something normal users should need to do manually.

Any emacs gurus want to propose a way to improve the situation?  i'm at
a bit of a loss.

  --dkg


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] NEWS: document notmuch reindex

2017-10-22 Thread Daniel Kahn Gillmor
Describe the introduction of the "reindex" subcommand.  This blurb
acknowledges Subject: instability under reindexing when multiple
copies exist (suggesting that this is something that needn't
necessarily hold up a release).
---
 NEWS | 13 +
 1 file changed, 13 insertions(+)

diff --git a/NEWS b/NEWS
index 895b7627..27d75e3f 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,19 @@ Out-of-tree builds
   has been dropped. The same can now be achieved more reliably using
   out-of-tree builds.
 
+Command Line Interface
+--
+
+Support for re-indexing existing messages
+
+  There is a new subcommand, `notmuch reindex`, which re-indexes all
+  messages matching supplied search terms.  This permits users to
+  change the way specific messages are indexed.
+
+  Note that for messages with multiple variants in the message
+  archive, the recorded Subject: of may change upon reindexing,
+  depending on the order in which the variants are indexed.
+
 Encrypted Mail
 --
 
-- 
2.14.2

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] NEWS: cleartext indexing

2017-10-22 Thread David Bremner
Daniel Kahn Gillmor  writes:

> give a short summary of cleartext indexing of encrypted e-mail
> messages.

That's fine and I've pushed it, but as written reindex will need it's
own NEWS item.

We also need to decide if the instability of subjects under reindex (see
one of the currently broken tests) is worth delaying a release for.

d
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] NEWS: cleartext indexing

2017-10-22 Thread Daniel Kahn Gillmor
give a short summary of cleartext indexing of encrypted e-mail
messages.
---
 NEWS | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/NEWS b/NEWS
index c2ebb644..895b7627 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,24 @@ Out-of-tree builds
   has been dropped. The same can now be achieved more reliably using
   out-of-tree builds.
 
+Encrypted Mail
+--
+
+Indexing cleartext of encrypted e-mails
+
+  It's now possible to include the cleartext of encrypted e-mails in
+  the notmuch index.  This makes it possible to search your encrypted
+  e-mails with the same ease as searching cleartext.  This can be done
+  on a per-message basis with the --try-decrypt argument to indexing
+  commands (new, insert, reindex), or by default by running "notmuch
+  config set index.try_decrypt true".
+
+  Note that the contents of the index are sufficient to roughly
+  reconstruct the cleartext of the message itself, so please ensure
+  that the notmuch index itself is adequately protected.  DO NOT USE
+  this feature without considering the security of your index.
+
+
 Notmuch 0.25.1 (2017-09-11)
 ===
 
-- 
2.14.2

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] NEWS: test suite out-of-tree builds

2017-10-22 Thread David Bremner
Jani Nikula  writes:

> Out-of-tree builds now work and supersede --root option.
> ---

pushed,

d
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: web interface to notmuch

2017-10-22 Thread Daniel Kahn Gillmor
On Sat 2017-10-21 23:00:00 +0300, Jani Nikula wrote:
> For the list archive, we could restrict to displaying text/plain only.

and text/x-diff, surely :)

But yeah, good point.

Brian, what do you think about such a constraint?  would that make your
implementation safe enough to put on the public Internet for a read-only
archive?

--dkg


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: nmbug backtrace due to .mailmap

2017-10-22 Thread Jani Nikula
On Mon, 16 Oct 2017, "W. Trevor King"  wrote:
> b. Comment out the ‘_insist_committed()’ line in nmbug's ‘pull’
>definition and try again.  Make sure you restore the check after
>the successful pull.

FWIW this fixed it for me, thanks.

BR,
Jani.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch