Re: [PATCH] python: Fix database.add_message

2017-09-12 Thread Gaute Hope
David Bremner writes on september 12, 2017 3:56: Dylan Baker writes: b10ce6bc23002d48916b1b2f375480e7540e3164 introduced a new index_file method as a replacement for add_message. It helpfully made add_message an alias for index_file, unfortunately it got the signature

[PATCH 08/10] add --try-decrypt=(true|false) to notmuch new

2017-09-12 Thread Daniel Kahn Gillmor
Try to decrypt any encrypted parts of newly-discovered messages while indexing them. The cleartext of any successfully-decrypted messages will be indexed, with tags applied in the same form as from notmuch insert --try-decrypt=true. Note: if the deprecated crypto.gpg_path configuration option is

Re: [PATCH 07/10] Define new config option index.try_decrypt

2017-09-12 Thread Daniel Kahn Gillmor
On Tue 2017-09-12 19:01:50 -0400, Daniel Kahn Gillmor wrote: > By default, notmuch won't try to decrypt on indexing. With this > patch, we make it possible to indicate a per-database preference using > the config variable "index.try_decrypt", which by default will be > false. I've just

Re: [PATCH v2] python: deprecated add_message calls index_file correctly and returns result

2017-09-12 Thread David Bremner
Dylan Baker writes: > The broken commit is in 0.25.1, but this patch isn't correct? It's going to > break alot if that's the case. > > Dylan I don't believe b10ce6bc2 is in 0.25.1; it's in master, and 0.25.1 is merged into master, so maybe that's the source of confusion.

[PATCH] emacs/address: use member instead of memq to check for pair

2017-09-12 Thread David Bremner
Quoting from the elisp reference: For other types (e.g., lists, vectors, strings), two arguments with the same contents or elements are not necessarily ‘eq’ to each other. Thanks to "Attic Hermit" for the fix. --- emacs/notmuch-address.el | 2 +- 1 file changed, 1 insertion(+), 1

Re: [PATCH v2] python: deprecated add_message calls index_file correctly and returns result

2017-09-12 Thread Dylan Baker
The broken commit is in 0.25.1, but this patch isn't correct? It's going to break alot if that's the case. Dylan Quoting David Bremner (2017-09-12 11:28:17) > Gaute Hope writes: > > > The deprecated Database.add_message now calls the new index_file with > > correct number

[PATCH 06/10] crypto: index encrypted parts when indexopts try_decrypt is set.

2017-09-12 Thread Daniel Kahn Gillmor
If we see index options that ask us to decrypt when indexing a message, and we encounter an encrypted part, we'll try to descend into it. If we can decrypt, we add the property index-decryption=success. If we can't decrypt (or recognize the encrypted type of mail), we add the property

[PATCH 10/10] add --try-decrypt=(true|false) to notmuch reindex

2017-09-12 Thread Daniel Kahn Gillmor
Try to decrypt any encrypted parts of newly-discovered messages while re-indexing them. The cleartext of any successfully-decrypted messages will be indexed, with tags applied in the same form as from notmuch insert --try-decrypt=true. Note: if the deprecated crypto.gpg_path configuration option

[PATCH 09/10] add --try-decrypt=(true|false) to notmuch insert

2017-09-12 Thread Daniel Kahn Gillmor
Allow an incoming message to be delivered while indexing the cleartext, on a per-message basis. This requires the secret keys for the message to be available. For the moment, the most functional approach is to ensure that gpg-agent is running and knows about any secret keys that might be useful

[PATCH 02/10] crypto: Move crypto.c into libutil

2017-09-12 Thread Daniel Kahn Gillmor
This prepares us for using the crypto object in both the library and the client. i've prefixed notmuch_crypto with _ to indicate that while this can be built into the library when needed, it's not something to be exported or used externally. --- Makefile.local| 1 - mime-node.c

[PATCH 07/10] Define new config option index.try_decrypt

2017-09-12 Thread Daniel Kahn Gillmor
By default, notmuch won't try to decrypt on indexing. With this patch, we make it possible to indicate a per-database preference using the config variable "index.try_decrypt", which by default will be false. --- doc/man1/notmuch-config.rst | 12 lib/indexopts.c | 16

[PATCH 03/10] crypto: make shared crypto code behave library-like

2017-09-12 Thread Daniel Kahn Gillmor
If we're going to reuse the crypto code across both the library and the client, then it needs to report error states properly and not write to stderr. --- lib/database.cc | 6 lib/notmuch.h | 17 +++ mime-node.c | 7 - util/crypto.c | 89

[PATCH 01/10] reorganize indexing of multipart/signed and multipart/encrypted

2017-09-12 Thread Daniel Kahn Gillmor
This makes no functional changes, but prepares the codebase for a cleaner changeset for dealing with indexing some encrypted messages in the clear. --- lib/index.cc | 42 ++ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/lib/index.cc

[PATCH 04/10] tests: prepare for more crypto tests (using add_gnupg_home)

2017-09-12 Thread Daniel Kahn Gillmor
Move add_gnupg_home to test-lib.sh to prepare it for reuse. --- test/T350-crypto.sh | 17 - test/test-lib.sh| 15 +++ 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/test/T350-crypto.sh b/test/T350-crypto.sh index 1d408af7..e1b8fd83 100755 ---

[PATCH 05/10] index: implement notmuch_indexopts_t with try_decrypt

2017-09-12 Thread Daniel Kahn Gillmor
This is currently mostly a wrapper around _notmuch_crypto_t that keeps its internals private and doesn't expose any of the GMime API. However, non-crypto indexing options might also be added later (e.g. filters or other transformations). --- lib/add-message.cc| 9 - lib/indexopts.c

Re: [PATCH v2] python: deprecated add_message calls index_file correctly and returns result

2017-09-12 Thread David Bremner
Gaute Hope writes: > The deprecated Database.add_message now calls the new index_file with > correct number of arguments (without an extra `self`), and returns the > tuple from index_file - as it used to do before. > > This change also adds a DeprecationWarning to the

Re: [PATCH] python: Fix database.add_message

2017-09-12 Thread Dylan Baker
Quoting David Bremner (2017-09-11 18:58:31) > David Bremner writes: > > > Dylan Baker writes: > > > >> b10ce6bc23002d48916b1b2f375480e7540e3164 introduced a new index_file > >> method as a replacement for add_message. It helpfully made add_message > >> an

Re: [PATCH v2] python: deprecated add_message calls index_file correctly and returns result

2017-09-12 Thread Daniel Kahn Gillmor
On Wed 2017-08-30 10:16:33 +0200, Gaute Hope wrote: > The deprecated Database.add_message now calls the new index_file with > correct number of arguments (without an extra `self`), and returns the > tuple from index_file - as it used to do before. > > This change also adds a DeprecationWarning to