notmuch
3 months agopython-cffi: enable out-of-tree builds
Daniel Kahn Gillmor [Fri, 22 May 2020 01:03:59 +0000 (21:03 -0400)]
python-cffi: enable out-of-tree builds

This is a simple hack to enable out-of-tree builds, a concern raised
by Tomi in id:m24kzjib9a.fsf@guru.guru-group.fi

This change at least enables "make check" to complete without error,
but I'm sure it could be improved.  I am not expert enough in
setuptools to know how.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Amended by db per id:87d06usa31.fsf@powell.devork.be

3 months agotest/test-lib.sh: fix two out of tree test issues
Tomi Ollila [Thu, 23 Apr 2020 21:26:43 +0000 (00:26 +0300)]
test/test-lib.sh: fix two out of tree test issues

json_check_nodes.py exists in source tree, not in out of tree
build tree. Added -B to the execution so source tree is not
"polluted" by a .pyc file when json_check_nodes.py is executed.

When creating run_emacs.sh make it load .elc files from out of
tree build tree, not from source tree if such files existed.
If existed, those may be outdated, or even created by some other
emacs than the one that was used to build .elc files in out of
tree build dir.

4 months agoemacs: Use `dolist' instead of `mapcar' for side-effects
Jonas Bernoulli [Sat, 25 Apr 2020 20:18:09 +0000 (22:18 +0200)]
emacs: Use `dolist' instead of `mapcar' for side-effects

As recommended by the byte-compiler.

4 months agosmime: Index cleartext of envelopedData when requested
Daniel Kahn Gillmor [Tue, 12 May 2020 22:29:39 +0000 (18:29 -0400)]
smime: Index cleartext of envelopedData when requested

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agosmime: Pass PKCS#7 envelopedData to node_decrypt_and_verify
Daniel Kahn Gillmor [Tue, 12 May 2020 22:29:38 +0000 (18:29 -0400)]
smime: Pass PKCS#7 envelopedData to node_decrypt_and_verify

This change means we can support "notmuch show --decrypt=true" for
S/MIME encrypted messages, resolving several outstanding broken tests,
including all the remaining S/MIME protected header examples.

We do not yet handle indexing the cleartext of S/MIME encrypted
messages, though.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agocrypto: handle PKCS#7 envelopedData in _notmuch_crypto_decrypt
Daniel Kahn Gillmor [Tue, 12 May 2020 22:29:37 +0000 (18:29 -0400)]
crypto: handle PKCS#7 envelopedData in _notmuch_crypto_decrypt

In the two places where _notmuch_crypto_decrypt handles
multipart/encrypted messages (PGP/MIME), we should also handle PKCS#7
envelopedData (S/MIME).

This is insufficient for fully handling S/MIME encrypted data because
_notmuch_crypto_decrypt isn't yet actually invoked for envelopedData
parts, but that will happen in the following changes.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agocrypto: Make _notmuch_crypto_decrypt take a GMimeObject
Daniel Kahn Gillmor [Tue, 12 May 2020 22:29:36 +0000 (18:29 -0400)]
crypto: Make _notmuch_crypto_decrypt take a GMimeObject

As we prepare to handle S/MIME-encrypted PKCS#7 EnvelopedData (which
is not multipart), we don't want to be limited to passing only
GMimeMultipartEncrypted MIME parts to _notmuch_crypto_decrypt.

There is no functional change here, just a matter of adjusting how we
pass arguments internally.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agocli/reply: Ignore PKCS#7 wrapper parts when replying
Daniel Kahn Gillmor [Tue, 12 May 2020 22:29:35 +0000 (18:29 -0400)]
cli/reply: Ignore PKCS#7 wrapper parts when replying

When composing a reply, no one wants to see this line in the proposed
message:

    Non-text part: application/pkcs7-mime

So we hide it, the same way we hide PGP/MIME cruft.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agocli/show: If a leaf part has children, show them instead of omitting
Daniel Kahn Gillmor [Tue, 12 May 2020 22:29:34 +0000 (18:29 -0400)]
cli/show: If a leaf part has children, show them instead of omitting

Until we did PKCS#7 unwrapping, no leaf MIME part could have a child.

Now, we treat the unwrapped MIME part as the child of the PKCS#7
SignedData object.  So in that case, we want to show it instead of
deliberately omitting the content.

This fixes the test of the protected subject in
id:smime-onepart-signed@protected-headers.example.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agocli: include wrapped part of PKCS#7 SignedData in the MIME tree
Daniel Kahn Gillmor [Tue, 12 May 2020 22:29:33 +0000 (18:29 -0400)]
cli: include wrapped part of PKCS#7 SignedData in the MIME tree

Unwrap a PKCS#7 SignedData part unconditionally when the cli is
traversing the MIME tree, and return it as a "child" of what would
otherwise be a leaf in the tree.

Unfortunately, this also breaks the JSON output.  We will fix that
next.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agosmime: Identify encrypted S/MIME parts during indexing
Daniel Kahn Gillmor [Tue, 12 May 2020 22:29:32 +0000 (18:29 -0400)]
smime: Identify encrypted S/MIME parts during indexing

We don't handle them correctly yet, but we can at least mark them as
being encrypted.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agolib: index PKCS7 SignedData parts
Daniel Kahn Gillmor [Tue, 12 May 2020 22:29:31 +0000 (18:29 -0400)]
lib: index PKCS7 SignedData parts

When we are indexing, we should treat SignedData parts the same way
that we treat a multipart object, indexing the wrapped part as a
distinct MIME object.

Unfortunately, this means doing some sort of cryptographic
verification whose results we throw away, because GMime doesn't offer
us any way to unwrap without doing signature verification.

I've opened https://github.com/jstedfast/gmime/issues/67 to request
the capability from GMime but for now, we'll just accept the
additional performance hit.

As we do this indexing, we also apply the "signed" tag, by analogy
with how we handle multipart/signed messages.  These days, that kind
of change should probably be done with a property instead, but that's
a different set of changes.  This one is just for consistency.

Note that we are currently *only* handling signedData parts, which are
basically clearsigned messages.  PKCS#7 parts can also be
envelopedData and authEnvelopedData (which are effectively encryption
layers), and compressedData (which afaict isn't implemented anywhere,
i've never encountered it).  We're laying the groundwork for indexing
these other S/MIME types here, but we're only dealing with signedData
for now.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agoconfigure: report GMime minimum version in ./configure output
Daniel Kahn Gillmor [Tue, 12 May 2020 21:17:09 +0000 (17:17 -0400)]
configure: report GMime minimum version in ./configure output

We already report the minimum version for Glib, zlib, and Xapian
development libraries.  For consistency, report it for GMime as well.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agosmime: tests of X.509 certificate validity are known-broken on GMime < 3.2.7
Daniel Kahn Gillmor [Fri, 22 May 2020 00:42:41 +0000 (20:42 -0400)]
smime: tests of X.509 certificate validity are known-broken on GMime < 3.2.7

When checking cryptographic signatures, Notmuch relies on GMime to
tell it whether the certificate that signs a message has a valid User
ID or not.

If the User ID is not valid, then notmuch does not report the signer's
User ID to the user.  This means that the consumer of notmuch's
cryptographic summary of a message (or of its protected headers) can
be confident in relaying the reported identity to the user.

However, some versions of GMime before 3.2.7 cannot report Certificate
validity for X.509 certificates.  This is resolved upstream in GMime
at https://github.com/jstedfast/gmime/pull/90.

We adapt to this by marking tests of reported User IDs for
S/MIME-signed messages as known-broken if GMime is older than 3.2.7
and has not been patched.

If GMime >= 3.2.7 and certificate validity still doesn't work for
X.509 certs, then there has likely been a regression in GMime and we
should fail early, during ./configure.

To break out these specific User ID checks from other checks, i had to
split some tests into two parts, and reuse $output across the two
subtests.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agotest-lib: mark function variables as local
Daniel Kahn Gillmor [Fri, 8 May 2020 23:24:38 +0000 (19:24 -0400)]
test-lib: mark function variables as local

Several functions in test/test-lib.sh used variable names that are
also used outside of those functions (e.g. $output and $expected are
used in many of the test scripts), but they are not expected to
communicate via those variables.

We mark those variables "local" within test-lib.sh so that they do not
get clobbered when used outside test-lib.

We also move the local variable declarations to beginning of each
function, to avoid weird gotchas with local variable declarations as
described in https://tldp.org/LDP/abs/html/localvar.html.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agonotmuch(1): clarify documentation about --option/value separators
Daniel Kahn Gillmor [Thu, 7 May 2020 19:26:45 +0000 (15:26 -0400)]
notmuch(1): clarify documentation about --option/value separators

id:CA+Tk8fzRiqxWpd=r8=DRvEewNZXUZgD7MKyRLB1A=R-LxxGEZw@mail.gmail.com
started a thread of discussion that showed that the cli's current
idiosyncrasies around dealing with boolean options were not
understandable.

This attempts to improve the documentation at least (actual changes to
the API might be better, but have not reached consensus).

Note that no one in the discussion thread identified any other
(non-boolean) command-line options that cannot use space as a
separator.  If such an option is identified (or introduced in the
future), it should be added explicitly to this part of the manual.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agolib: replace STRNCMP_LITERAL in __message_remove_indexed_terms
David Bremner [Mon, 4 May 2020 13:55:43 +0000 (10:55 -0300)]
lib: replace STRNCMP_LITERAL in __message_remove_indexed_terms

strncmp looks for a prefix that matches, which is very much not what
we want here. This fixes the bug reported by Franz Fellner in
id:1588595993-ner-8.651@TPL520

4 months agotest: known broken test for reindex tag preservation
David Bremner [Mon, 4 May 2020 13:49:43 +0000 (10:49 -0300)]
test: known broken test for reindex tag preservation

In id:1588595993-ner-8.651@TPL520 Franz Fellner reported that tags
starting with 'attachment' are removed by 'notmuch reindex'. This is
probably related to the use of STRNCMP_LITERAL in
_notmuch_message_remove_indexed_terms.

4 months agotests: disable CRL checks from gpgsm
Daniel Kahn Gillmor [Thu, 19 Mar 2020 04:15:08 +0000 (00:15 -0400)]
tests: disable CRL checks from gpgsm

GPGME has a strange failure mode when it is in offline mode, and/or
when certificates don't have any CRLs: in particular, it refuses to
accept the validity of any certificate other than a "root" cert.

This can be worked around by setting the `disable-crl-checks`
configuration variable for gpgsm.

I've reported this to the GPGME upstream at
https://dev.gnupg.org/T4883, but I have no idea how it will be
resolved.  In the meantime, we'll just work around it.

Note that this fixes the test for verification of
id:smime-multipart-signed@protected-headers.example, because
multipart/signed messages are already handled correctly (one-part
PKCS#7 messages will get fixed later).

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agotest/protected-headers: Add tests for S/MIME protected headers
Daniel Kahn Gillmor [Tue, 28 Apr 2020 18:57:22 +0000 (14:57 -0400)]
test/protected-headers: Add tests for S/MIME protected headers

Recognize the protected subject for S/MIME example protected header
messages.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agotests/smime: add tests for S/MIME SignedData
Daniel Kahn Gillmor [Tue, 28 Apr 2020 18:57:21 +0000 (14:57 -0400)]
tests/smime: add tests for S/MIME SignedData

Add a simple S/MIME SignedData message, taken from an upcoming draft
of
https://datatracker.ietf.org/doc/draft-autocrypt-lamps-protected-headers/

RFC 8551 describes a SignedData, a one-part clearsigned object that is
more resistant to common patterns of MTA message munging than
multipart/signed (but has the downside that it is only readable by
clients that implement S/MIME).

To make sure sure notmuch can handle this kind of object, we want to
know a few things:

Already working:

 - Is the content of the SignedData object indexed?  It actually is
   right now because of dumb luck -- i think we're indexing the raw
   CMS object and it happens to contain the cleartext of the message
   in a way that we can consume it before passing it on to Xapian.
 - Are we accidentally indexing the embedded PKCS#7 certificates? We
   don't want to, and for some reason I don't understand, our indexing
   is actually skipping the embedded certificates already.  That's
   good!

Still need fixing:
 - do we know the MIME type of the embedded part?
 - do we know that the message is signed?
 - can notmuch-show read its content?
 - can notmuch-show indicate the signature validity?
 - can notmuch-reply properly quote and attribute content?

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agotest-lib.sh: add test_valid_json
Daniel Kahn Gillmor [Tue, 28 Apr 2020 18:57:20 +0000 (14:57 -0400)]
test-lib.sh: add test_valid_json

This test does exactly what it says on the tin.  It expects JSON data
to be parseable by Python, at least.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agotests/smime: Test indexing cleartext of envelopedData
Daniel Kahn Gillmor [Tue, 28 Apr 2020 18:57:19 +0000 (14:57 -0400)]
tests/smime: Test indexing cleartext of envelopedData

These tests describe some simple behavior we would expect to work if
we were to correctly index the cleartext of encrypted S/MIME messages
(PKCS#7 envelopedData).

Of course, they don't currently pass, so we mark them known-broken.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agotests/smime: Verify cryptographic message status
Daniel Kahn Gillmor [Tue, 28 Apr 2020 18:57:18 +0000 (14:57 -0400)]
tests/smime: Verify cryptographic message status

When consuming a signed+encrypted S/MIME message generated by emacs,
we expect to see the same cryptographic properties for the message as
a whole.  This is not done correctly yet, so the test is marked as
known broken.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agotests: Add S/MIME messages to protected-headers corpus
Daniel Kahn Gillmor [Tue, 28 Apr 2020 18:57:17 +0000 (14:57 -0400)]
tests: Add S/MIME messages to protected-headers corpus

These sample messages are taken directly from the Protected Headers
draft:

https://www.ietf.org/id/draft-autocrypt-lamps-protected-headers-02.html

Note that this commit doesn't strictly pass the common git pre-commit
hook due to introducing some trailing whitespace.  That's just the
nature of the corpus, though.  We should have that trailing
whitespace, so I've made this commit with --no-verify.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agotests/smime: include secret key material for Bob
Daniel Kahn Gillmor [Thu, 30 Apr 2020 19:35:21 +0000 (15:35 -0400)]
tests/smime: include secret key material for Bob

This is taken from the same Internet Draft that test/smime/ca.crt
comes from.  See that draft for more details.
https://www.ietf.org/id/draft-dkg-lamps-samples-02.html#name-pkcs12-object-for-bob

We don't use it yet, but it will be used to decrypt other messages in
the test suite.

Note that we include it here with an empty passphrase, rather than
with the passphrase "bob" that it is supplied with in the I-D.  The
underlying cryptographic material is the same, but this way we can
import cleanly into gpgsm without having a passphrase set on it (gpgsm
converts an empty-string passphrase into no passphrase at all on
import).

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agotest: Allow tests to have both gpg and gpgsm active at once
Daniel Kahn Gillmor [Thu, 30 Apr 2020 19:34:21 +0000 (15:34 -0400)]
test: Allow tests to have both gpg and gpgsm active at once

Without this fix, we couldn't run both add_gnupg_home and
add_gpgsm_home in the same test script.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agotests/smime: avoid copying the key+cert.pem around
Daniel Kahn Gillmor [Tue, 28 Apr 2020 18:57:14 +0000 (14:57 -0400)]
tests/smime: avoid copying the key+cert.pem around

No functional change.

We no longer need to identify the key and cert to mml-mode when
sending an S/MIME message, so making a copy of key+cert.pem to
test_suite.pem is superfluous.  Get rid of the extra file.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agotests/smime: Use gpgsm instead of openssl for mml creation of S/MIME msgs
Daniel Kahn Gillmor [Tue, 28 Apr 2020 18:57:13 +0000 (14:57 -0400)]
tests/smime: Use gpgsm instead of openssl for mml creation of S/MIME msgs

The documentation for message mode clearly states that EasyPG (which
uses GnuPG) is the default and recommended way to use S/MIME with
mml-secure:

[0] https://www.gnu.org/software/emacs/manual/html_node/message/Using-S_002fMIME.html

To ensure that this mode works, we just need to import the secret key
in question into gpgsm in addition to the public key.  gpgsm should be
able pick the right keys+certificates to use based on To/From headers,
so we don't have to specify anything manually in the #secure mml tag.

The import process from the OpenSSL-preferred form (cert+secretkey) is
rather ugly, because gpgsm wants to see a PKCS#12 object when
importing secret keys.

Note that EasyPG generates the more modern Content-Type:
application/pkcs7-signature instead of application/x-pkcs7-signature
for the detached signature.

We are also obliged to manually set gpgsm's include-certs setting to 1
because gpgsm defaults to send "everything but the root cert".  In our
weird test case, the certificate we're using is self-signed, so it
*is* the root cert, which means that gpgsm doesn't include it by
default.  Setting it to 1 forces inclusion of the signer's cert, which
satisfies openssl's smime subcommand. See https://dev.gnupg.org/T4878
for more details.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agotests/smime: consistently quote $GNUPGHOME
Daniel Kahn Gillmor [Tue, 28 Apr 2020 18:57:12 +0000 (14:57 -0400)]
tests/smime: consistently quote $GNUPGHOME

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agotests/smime: Include the Sample LAMPS Certificate Authority
Daniel Kahn Gillmor [Thu, 30 Apr 2020 19:33:29 +0000 (15:33 -0400)]
tests/smime: Include the Sample LAMPS Certificate Authority

This CA is useful for test suites and the like, but is not an
actually-secure CA, because its secret key material is also published.

I plan to use it for its intended purpose in the notmuch test suite.

It was copied from this Internet Draft:

https://tools.ietf.org/id/draft-dkg-lamps-samples-01.html#name-certificate-authority-certi

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agotests/smime: Always use --batch with gpgsm
Daniel Kahn Gillmor [Tue, 28 Apr 2020 18:57:10 +0000 (14:57 -0400)]
tests/smime: Always use --batch with gpgsm

GnuPG's gpgsm, like gpg, should always be used with --batch when it is
invoked in a non-interactive environment.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agotests: move add_gpgsm_home to test-lib.sh
Daniel Kahn Gillmor [Tue, 28 Apr 2020 18:57:09 +0000 (14:57 -0400)]
tests: move add_gpgsm_home to test-lib.sh

This allows us to test S/MIME messages in other tests.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 months agoutil/zlib-extra: de-inline gzerror_str
David Bremner [Mon, 27 Apr 2020 12:24:22 +0000 (09:24 -0300)]
util/zlib-extra: de-inline gzerror_str

It turns out that putting inline functions in C header files is not a
good idea, and can cause linking problems if the compiler decides not
to inline them.  In principle this is solvable by using a "static
inline" declaration, but this potentially makes a copy in every
compilation unit. Since we don't actually care about the performance
of this function, just use a non-inline function.

5 months agoemacs: Use `cl-lib' instead of deprecated `cl'
Jonas Bernoulli [Sat, 25 Apr 2020 20:18:07 +0000 (22:18 +0200)]
emacs: Use `cl-lib' instead of deprecated `cl'

Starting with Emacs 27 the old `cl' implementation is finally
considered obsolete.  Previously its use was strongly discouraged
at run-time but one was still allowed to use it at compile-time.

For the most part the transition is very simple and boils down to
adding the "cl-" prefix to some symbols.  A few replacements do not
follow that simple pattern; e.g. `first' is replaced with `car',
even though the alias `cl-first' exists, because the latter is not
idiomatic emacs-lisp.

In a few cases we start using `pcase-let' or `pcase-lambda' instead
of renaming e.g. `first' to `car'.  That way we can remind the reader
of the meaning of the various parts of the data that is being
deconstructed.

An obsolete `lexical-let' and a `lexical-let*' are replaced with their
regular variants `let' and `let*' even though we do not at the same
time enable `lexical-binding' for that file.  That is the right thing
to do because it does not actually make a difference in those cases
whether lexical bindings are used or not, and because this should be
enabled in a separate commit.

We need to explicitly depend on the `cl-lib' package because Emacs
24.1 and 24.2 lack that library.  When using these releases we end
up using the backport from GNU Elpa.

We need to explicitly require the `pcase' library because
`pcase-dolist' was not autoloaded until Emacs 25.1.

5 months agotest: sort the output of the "prefix" test in T610-message-property
Olivier Taïbi [Sun, 19 Apr 2020 16:06:19 +0000 (18:06 +0200)]
test: sort the output of the "prefix" test in T610-message-property

This test extracts values from a (key,value) map where multiple entries
can have the same key, and the entries are sorted by key, but not by
value.  The test incorrectly assumes that the values will be sorted as
well, so sort the output.

5 months agobuild: drop support for xapian versions less than 1.4
Tomi Ollila [Tue, 21 Apr 2020 21:07:29 +0000 (00:07 +0300)]
build: drop support for xapian versions less than 1.4

Xapian 1.4 is over 3 years old now (1.4.0 released 2016-06-24),
and 1.2 has been deprecated in Notmuch version 0.27 (2018-06-13).

Xapian 1.4 supports compaction, field processors and retry locking;
conditionals checking compaction and field processors were removed
but user may want to disable retry locking at configure time so it
is kept.

5 months agoemacs: Explicitly depend on Emacs 24
Jonas Bernoulli [Wed, 15 Apr 2020 18:28:21 +0000 (20:28 +0200)]
emacs: Explicitly depend on Emacs 24

We use various things that were not available in earlier versions.

5 months agoemacs: Declare function notmuch-show-get-message-id
Jonas Bernoulli [Wed, 15 Apr 2020 18:28:20 +0000 (20:28 +0200)]
emacs: Declare function notmuch-show-get-message-id

5 months agogitignore: Ignore generated python-cffi files
Jonas Bernoulli [Wed, 15 Apr 2020 18:28:19 +0000 (20:28 +0200)]
gitignore: Ignore generated python-cffi files

5 months agoutil: after gzgets(), Z_STREAM_END means EOF, not error
Olivier Taïbi [Tue, 14 Apr 2020 17:38:40 +0000 (19:38 +0200)]
util: after gzgets(), Z_STREAM_END means EOF, not error

Context: I am compiling notmuch on OpenBSD which has a rather old zlib
1.2.3.  It seems that the behaviour of gzgets() changed slightly between
this version and more recent versions, but the manual does not reflect
that change.  Note that zlib's manual:
- does not specify which error code (Z_OK or Z_STREAM_END) is set when
  EOF is reached,
- does not indicate the meaning of Z_STREAM_END after gzgets(), but
  based on its meaning as a possible return value of inflate(), I would
  guess that it means EOF.

amended by db: tidy commit message

5 months agocli/restore: gzerror() after gzclose_r() is a use after free
Olivier Taïbi [Tue, 14 Apr 2020 17:36:27 +0000 (19:36 +0200)]
cli/restore: gzerror() after gzclose_r() is a use after free

Calling gzerror() (indirectly via gzerror_str()) after gzclose_r is a
use after free, according to zlib's manual.

amended by db: tidied commit message

5 months agoemacs: use def instead of initial-input for notmuch-show-browse-urls
Keegan Carruthers-Smith [Mon, 13 Apr 2020 19:58:19 +0000 (21:58 +0200)]
emacs: use def instead of initial-input for notmuch-show-browse-urls

This is the non-deprecated way to use completing-read. Additionally
the old use was broken when using ivy for completing-read. For user's
using completing-read-default they won't see the default URL now, but
if they hit enter it will be visited. Alternatively they can select
it with M-n.

From the completing-read documentation for initial-input:

 This feature is deprecated--it is best to pass nil for INITIAL-INPUT
 and supply the default value DEF instead.  The user can yank the
 default value into the minibuffer easily using M-n.

Additionally collection is now all urls, rather than all but the
first. I'm not sure why "(cdr urls)" was previously done.

5 months agoemacs: introduce notmuch-search-by-tag
Keegan Carruthers-Smith [Mon, 13 Apr 2020 20:10:50 +0000 (22:10 +0200)]
emacs: introduce notmuch-search-by-tag

This is like notmuch-search-filter-by-tag, but creates a new search
rather than filtering the current search. We add this to
notmuch-common-keymap since this can be used by many contexts. We bind
to the key "t", which is the same key used by
notmuch-search-filter-by-tag in notmuch-search-mode-map. This is done
intentionally since the keybinding for notmuch-search-mode-map can be
seen as a specialization of creating a new search.

This change was motivated for use in "notmuch-hello". It is a more
convenient way to search a tag than expanding the list of all tags. I
also noticed many saved searches people use are simply tags.

5 months agocli/dump: replace use of gzprintf with gzputs for config values
David Bremner [Mon, 13 Apr 2020 02:01:38 +0000 (23:01 -0300)]
cli/dump: replace use of gzprintf with gzputs for config values

These can be large, and hit buffer limitations of gzprintf.

5 months agocli/dump: define GZPUTS and use it in notmuch-dump
David Bremner [Mon, 13 Apr 2020 01:59:12 +0000 (22:59 -0300)]
cli/dump: define GZPUTS and use it in notmuch-dump

Similarly to GZPRINTF, this is a drop in replacement that can be
improved where needd.

5 months agocli/dump: define GZPRINTF macro and use it in place of gzprintf
David Bremner [Mon, 13 Apr 2020 01:39:11 +0000 (22:39 -0300)]
cli/dump: define GZPRINTF macro and use it in place of gzprintf

This will at least catch errors, and can be replaced with more
sophisticated error handling where appropriate.

5 months agostatus: add print_status_gzbytes
David Bremner [Sun, 12 Apr 2020 23:17:20 +0000 (20:17 -0300)]
status: add print_status_gzbytes

This is in the client code, rather than libnotmuch_util, because it
prints to stderr. Also it in pretends to generate notmuch status
codes.

5 months agodon't pass NULL as second parameter to gzerror
David Bremner [Sun, 12 Apr 2020 23:00:31 +0000 (20:00 -0300)]
don't pass NULL as second parameter to gzerror

Although (as of 1.2.11) zlib checks this parameter before writing to
it, the docs don't promise to keep doing so, so be safe.

5 months agotest: add known_broken test for dumping large stored queries
David Bremner [Sun, 12 Apr 2020 17:30:12 +0000 (14:30 -0300)]
test: add known_broken test for dumping large stored queries

'qsx' reported a bug on #notmuch with notmuch-dump and large stored
queries. This test will pass (on my machine) if the value of `repeat'
is made smaller.

Reported-By: Thomas Schneider <qsx@chaotikum.eu>
5 months agoemacs/tree: add x/X bindings
William Casarin [Sat, 4 Apr 2020 20:41:42 +0000 (13:41 -0700)]
emacs/tree: add x/X bindings

Add x and X binds to notmuch-tree for functionally that we have in
notmuch-show.

The notmuch-tree-quit binding is somewhat redundant, since it is
handled by notmuch-bury-or-kill-this-buffer which is bound to q.

Signed-off-by: William Casarin <jb55@jb55.com>
5 months agoemacs/tree: add notmuch-tree-archive-thread-then-exit
William Casarin [Sat, 4 Apr 2020 20:41:41 +0000 (13:41 -0700)]
emacs/tree: add notmuch-tree-archive-thread-then-exit

This is the notmuch-tree version of
notmuch-show-archive-thread-then-exit

Signed-off-by: William Casarin <jb55@jb55.com>
5 months agoemacs/tree: add notmuch-tree-archive-message-than-next-or-exit
William Casarin [Sat, 4 Apr 2020 20:41:35 +0000 (13:41 -0700)]
emacs/tree: add notmuch-tree-archive-message-than-next-or-exit

This is the notmuch-tree version of
notmuch-show-archive-message-than-next-or-exit.

Signed-off-by: William Casarin <jb55@jb55.com>
5 months agoemacs/tree: add kill-both prefix argument to notmuch-tree-quit
William Casarin [Sat, 4 Apr 2020 20:41:34 +0000 (13:41 -0700)]
emacs/tree: add kill-both prefix argument to notmuch-tree-quit

This allows us to close both windows at the same time.

Signed-off-by: William Casarin <jb55@jb55.com>
5 months agoemacs/tree: add notmuch-tree-matching-message
William Casarin [Sat, 4 Apr 2020 20:41:33 +0000 (13:41 -0700)]
emacs/tree: add notmuch-tree-matching-message

This functions removes some duplicate logic between
notmuch-tree-{next,prev}-matching-message

We do this because we will be adding some additional logic similar to
the notmuch-show-next-open-message function, and it will help if this
logic is all in one place.

Signed-off-by: William Casarin <jb55@jb55.com>
5 months agoemacs/tree: add notmuch-tree-goto-matching-message
William Casarin [Sat, 4 Apr 2020 20:41:32 +0000 (13:41 -0700)]
emacs/tree: add notmuch-tree-goto-matching-message

This function captures some common logic when jumping to matching
messages in notmuch-tree mode.

We also add a new return value (t or nil), that indicates if there was
a next matching message in the thread to show.

Signed-off-by: William Casarin <jb55@jb55.com>
5 months agoemacs/tree: return true if a thread was found in next-thread
William Casarin [Sat, 4 Apr 2020 20:41:31 +0000 (13:41 -0700)]
emacs/tree: return true if a thread was found in next-thread

This will allow us to pop back to parent buffers when there are no
more threads to jump to.

Signed-off-by: William Casarin <jb55@jb55.com>
5 months agonmbug: explicitly prefer python3
Daniel Kahn Gillmor [Fri, 9 Feb 2018 04:32:11 +0000 (23:32 -0500)]
nmbug: explicitly prefer python3

nmbug and notmuch-report are developer tools.  It's 2018, and all
developers should have python3 available.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
5 months agodebian: Add packaging for python3-notmuch2
Daniel Kahn Gillmor [Mon, 23 Dec 2019 22:17:22 +0000 (17:17 -0500)]
debian: Add packaging for python3-notmuch2

Ship a new debian package for the notmuch2 CFFI-based Python interface
to notmuch.

Unlike the notmuch python module, the new notmuch2 module is no longer
arch-independent, because it builds and ships a shared object in
addition to the python code.

This patch encourages new downstream development to rely on notmuch2
instead of on notmuch, to get the benefits of the new module.

I welcome any suggested improvements to this packaging, but it appears
to me to be sufficient to get "import notmuch2" to work and do some
basic tests.

5 months agodoc: Drop obsolete MSCGEN_PATH, PERL_PATH from doxygen configuration
Daniel Kahn Gillmor [Tue, 17 Mar 2020 16:28:26 +0000 (12:28 -0400)]
doc: Drop obsolete MSCGEN_PATH, PERL_PATH from doxygen configuration

Since doxygen 1.8.16, MSCGEN_PATH and PERL_PATH are obsolete:

MSCGEN_PATH:
  https://github.com/doxygen/doxygen/commit/873e0ccfbe43ef98d4858beb08eef37631ae3cf6
PERL_PATH:
  https://github.com/doxygen/doxygen/commit/6d1535c38fe6bdaa2a00fff0e7e43774a740a4ce

I don't think that the notmuch builds ever depended on them in the
first place, and including them in the default config yields the
following two warnings:

```
doxygen ./doc/doxygen.cfg
warning: Tag 'PERL_PATH' at line 267 of file './doc/doxygen.cfg' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'MSCGEN_PATH' at line 272 of file './doc/doxygen.cfg' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
```

Remove them to avoid the warnings.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
6 months agoMake notmuch-mutt script more portable
Greg Anders [Mon, 16 Mar 2020 18:27:42 +0000 (12:27 -0600)]
Make notmuch-mutt script more portable

The -D flag to install (used in the Makefile) is GNU-specific and does
not work on BSD distributions (i.e. macOS). Likewise with the xargs -r
flag. These changes use portable alternatives to these flags while
preserving the exact behavior.

6 months agoemacs: avoid warning about notmuch-show-get-message-id
Daniel Kahn Gillmor [Wed, 18 Mar 2020 17:11:53 +0000 (13:11 -0400)]
emacs: avoid warning about notmuch-show-get-message-id

Without this change, we see the following warning when compiling the
elisp:

```
EMACS emacs/notmuch-crypto.elc

In end of data:
emacs/notmuch-crypto.el:266:1:Warning: the function
    ‘notmuch-show-get-message-id’ is not known to be defined.
```

Thanks to Örjan Ekeberg and David Edmondson for their followup about
this.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
6 months agomime-node: Clean up unwrapped MIME parts correctly.
Daniel Kahn Gillmor [Thu, 19 Mar 2020 05:41:45 +0000 (01:41 -0400)]
mime-node: Clean up unwrapped MIME parts correctly.

Avoid a memory leak in the notmuch command line.

gmime_multipart_encrypted_decrypt returns a GMimeObject marked by
GMime as "transfer full", so we are supposed to clean up after it.

When parsing a message, notmuch would leak one GMimeObject part per
multipart/encrypted MIME layer.  We clean it up by analogy with
cleaning up the signature list associated with a MIME node.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
6 months agomime-node: rename decrypted_child to unwrapped_child
Daniel Kahn Gillmor [Thu, 19 Mar 2020 05:41:44 +0000 (01:41 -0400)]
mime-node: rename decrypted_child to unwrapped_child

When walking the MIME tree, we might need to extract a new MIME
object.  Thus far, we've only done it when decrypting
multipart/encrypted messages, but PKCS#7 (RFC 8551, S/MIME) has
several other transformations that warrant a comparable form of
unwrapping.

Make this member re-usable for PKCS#7 unwrappings as well as
multipart/encrypted decryptions.

This change is just a naming change, it has no effect on function.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
6 months agonotmuch-hello/jump: allow saved searches to specify unthreaded mode
Mark Walters [Thu, 27 Feb 2020 17:16:52 +0000 (17:16 +0000)]
notmuch-hello/jump: allow saved searches to specify unthreaded mode

Saved searches in notmuch-hello and notmuch-jump can specify whether
to use search mode or tree mode. This adds an option for them to
specify unthreaded mode.

6 months agoAdd a U binding to switch to unthreaded from other views
Mark Walters [Thu, 27 Feb 2020 17:16:51 +0000 (17:16 +0000)]
Add a U binding to switch to unthreaded from other views

We have shortcuts S and Z to let the user switch to Search view and
Tree view with the current search. Add U to let the user switch to
unthreaded view from the current search, and ensure that S and Z
switch from unthreaded to search and tree veiew respectively.

6 months agoUnthreaded mode: allow user to choose different `show out' than tree
Mark Walters [Thu, 27 Feb 2020 17:16:50 +0000 (17:16 +0000)]
Unthreaded mode: allow user to choose different `show out' than tree

Tree mode allows the user to choose whether to use the split screen
displaying just the current message or a full screen displaying the
entire thread. As unthreaded mode is quite different in use the user
may want a different customisation for this mode.

6 months agoUnthreaded mode: allow different result format
Mark Walters [Thu, 27 Feb 2020 17:16:49 +0000 (17:16 +0000)]
Unthreaded mode: allow different result format

It is likely that the user will want a different line format for
unthreaded mode from tree mode; in particular the thread structure
graphics are unnecessary in unthreaded mode.

Add a new customisable variable and set it to something sensible.

6 months agoIntroduce unthreaded mode
Mark Walters [Thu, 27 Feb 2020 17:16:48 +0000 (17:16 +0000)]
Introduce unthreaded mode

This commit introduces a new 'unthreaded' search mode where each
matching message is shown on a separate line. It shares almost all of
its code with tree view. Subsequent commits will allow it to diverge
slightly in appearance.

6 months agonotmuch-show.c: add an option for messages to be returned unthreaded
Mark Walters [Thu, 27 Feb 2020 17:16:47 +0000 (17:16 +0000)]
notmuch-show.c: add an option for messages to be returned unthreaded

This adds a --unthreaded option to notmuch show to tell it to return
the matching messages in an unthreaded order (so just by date).

To make it easier for users, in particular for notmuch-tree.el, we
output each message with the same "nesting" as if it were an entire
thread in its own right.

amended by db: s/status= /status = /

6 months agoCorrect doxygen framing for libnotmuch.h
Daniel Kahn Gillmor [Wed, 18 Mar 2020 02:57:42 +0000 (22:57 -0400)]
Correct doxygen framing for libnotmuch.h

Apparently doxygen needs its comments formatted in a specific way to
notice that the group is closed.

Without this fix, with doxygen 1.8.16-2 we see:

```
doxygen ./doc/doxygen.cfg
…/notmuch/lib/notmuch.h:2322: warning: end of file while inside a group
```

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
6 months agomime-node: Pass the correct flags to g_mime_multipart_signed_verify
Daniel Kahn Gillmor [Wed, 18 Mar 2020 07:47:48 +0000 (03:47 -0400)]
mime-node: Pass the correct flags to g_mime_multipart_signed_verify

GMIME_ENCRYPT_NONE and GMIME_VERIFY_NONE have the same value, but they
are different enumerated types.  So in C, this is a cosmetic change,
but it is technically correct if we only had stricter typing.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
6 months agotests/smime: fix typo in README
Daniel Kahn Gillmor [Wed, 18 Mar 2020 07:48:40 +0000 (03:48 -0400)]
tests/smime: fix typo in README

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseaman.net>
6 months agoconfigure: Check GMime version properly
Daniel Kahn Gillmor [Wed, 18 Mar 2020 08:02:50 +0000 (04:02 -0400)]
configure: Check GMime version properly

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
7 months agoDrop deprecated/unused crypto.gpg_path
Daniel Kahn Gillmor [Tue, 18 Feb 2020 22:42:57 +0000 (17:42 -0500)]
Drop deprecated/unused crypto.gpg_path

crypto.gpg_path was only used when we built against gmime versions
before 3.0.  Since we now depend on gmime 3.0.3 or later, it is
meaningless.

The removal of the field from the _notmuch_config struct would be an
ABI change if that struct were externally exposed, but it is not, so
it's safe to unilaterally remove it.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
7 months agosprinter: change integer method to use int64_t
Peter Wang [Sat, 8 Feb 2020 01:49:22 +0000 (12:49 +1100)]
sprinter: change integer method to use int64_t

In particular, timestamps beyond 2038 could overflow the sprinter
interface on systems where time_t is 64-bit but 'int' is a signed 32-bit
integer type.

7 months agotest: add known broken test with timestamp beyond 2038
Peter Wang [Sat, 8 Feb 2020 01:49:21 +0000 (12:49 +1100)]
test: add known broken test with timestamp beyond 2038

8 months agodoc: clean up manpage description of "notmuch-config list" output
Daniel Kahn Gillmor [Fri, 10 Jan 2020 18:58:07 +0000 (13:58 -0500)]
doc: clean up manpage description of "notmuch-config list" output

The escaping in the description of the output of "notmuch-config list"
appears to have been inherited from some previous attempts at
documentation.  It leaked out in the actual generated manpage
documentation, where it looks like this:

       list   Every  configuration  item is printed to stdout, each on a
              separate line of the form:

                 *section*.\ *item*\ =\ *value*

This simplification cleans up the overescaping.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
8 months agodebian: add Build-Depends-Package for libnotmuch5.symbols
Daniel Kahn Gillmor [Mon, 23 Dec 2019 20:14:38 +0000 (15:14 -0500)]
debian: add Build-Depends-Package for libnotmuch5.symbols

See lintian informational tag
symbols-file-missing-build-depends-package-field for hints about this
minor metadata update.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
8 months agoemacs: don't start processes stopped
Steven Allen [Fri, 3 Jan 2020 17:04:00 +0000 (09:04 -0800)]
emacs: don't start processes stopped

It causes this function to fail with:

    let: Wrong type argument: null, t

Support for this was removed from Emacs in April
2019 (5c5e309527e6b582e2c04b83e7af45f3144863ac) because it never
worked correctly (apparently).

This also shouldn't be necessary as sentinels will not be called
unless emacs is idle or waiting for input. Therefore, the
`process-put' calls immediately following the `make-process' call
should always complete before the sentinel is first called.

8 months agolegacy-display: drop tests that try to match headers in a Legacy Display part
Daniel Kahn Gillmor [Mon, 23 Dec 2019 17:39:27 +0000 (12:39 -0500)]
legacy-display: drop tests that try to match headers in a Legacy Display part

These tests were an attempt to establish that the content of the
"Legacy Display" part is the same as the actual protected headers of
the message.  But this is more conservative than we need to be.

https://www.ietf.org/id/draft-autocrypt-lamps-protected-headers-02.html
section 5.3 makes clear that the Legacy Display part is purely
decorative, and section 5.2.1 clarifies that the detection can be done
purely by MIME structure and Content-Type alone.

Furthermore, now that we're accepting text/plain Legacy Display parts,
it's not clear the lines in the Legacy Display part should be
interpreted as needing an exact string match (e.g. "real" headers are
likely to be RFC 2047 encoded, but the text/plain Legacy Display part
probably should not be).

The concerns that motivated this test in the past were twofold: that
we might accidentally hide some information from the reader of the
message that they should have available to them, or that we could
introduce a covert channel that would be invisible to other clients.

I no longer think these are significant concerns:

 a) There will be no accidental misidentification of a Legacy Display
    part.  The identification of the Legacy Display part is
    unambiguous due to MIME structure and Content-Type.  MIME
    structure MUST be the first child part of a two-part
    multipart/mixed Cryptographic Payload. And the
    protected-headers=v1 content-type parameter must be present on
    both the cryptographic payload and the legacy display part, so no
    one would accidentally generate this structure and have it be
    accidentally matched.

 b) As for creating a covert channel, many such channels already
    exist.  For example, non-standard e-mail headers, custom MIME
    types, unusual MIME structures, etc, all make it possible to ship
    some content in a message that will be visible in some MUAs but
    not in others.  This doesn't make the situation demonstrably
    worse.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
8 months agolegacy-display: accept text/plain legacy display parts
Daniel Kahn Gillmor [Tue, 24 Dec 2019 22:05:44 +0000 (17:05 -0500)]
legacy-display: accept text/plain legacy display parts

https://www.ietf.org/id/draft-autocrypt-lamps-protected-headers-02.html
Makes it clear that the "Legacy Display" part of an encrypted message
with protected headers can (and indeed, should) be of content-type
text/plain, though some clients still generate the Legacy Display part
as content-type text/rfc822-headers.  Notmuch should recognize the
part whichever of the two content-types it uses.

See also discussion in
https://github.com/autocrypt/protected-headers/issues/23 for why the
community of implementers is moving in the direction of text/plain.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
9 months agodebian: Override lintian suggestion to move elpa-notmuch to Section: lisp
Daniel Kahn Gillmor [Mon, 23 Dec 2019 21:35:40 +0000 (16:35 -0500)]
debian: Override lintian suggestion to move elpa-notmuch to Section: lisp

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
9 months agopython/notmuch2: fix typo for "destroyed"
Daniel Kahn Gillmor [Mon, 23 Dec 2019 21:06:48 +0000 (16:06 -0500)]
python/notmuch2: fix typo for "destroyed"

Another fix to the docstrings, this time for the English part of the
docstrings, not the Python class name.  No functional changes here.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
9 months agopython/notmuch2: fix typo for ObjectDestroyedError
Daniel Kahn Gillmor [Mon, 23 Dec 2019 21:02:16 +0000 (16:02 -0500)]
python/notmuch2: fix typo for ObjectDestroyedError

There is no functional change here, just a fix to a typo in the
docstrings.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
9 months agodebian: move packaging to dh 12
Daniel Kahn Gillmor [Mon, 9 Dec 2019 18:49:10 +0000 (13:49 -0500)]
debian: move packaging to dh 12

9 months agodebian elpa-notmuch: ship elisp and .png from "make install"
Daniel Kahn Gillmor [Mon, 9 Dec 2019 18:49:09 +0000 (13:49 -0500)]
debian elpa-notmuch: ship elisp and .png from "make install"

Rather than ship from the source directories, ship these files from
where they're installed by "make install".

This doesn't resolve all the dh_missing warnings yet (due to #946142),
but it leaves the last bit of that problem in the hands of the dh-elpa
package, and it's not due to notmuch's packaging any longer.

Note that notmuch-pkg.el is only relevant for elpa, so it was not
installed by "make install", and has to be extracted deliberately from
the source tree.

Note also that we now don't ship make-deps.el or rstdoc.el, as these
are build tools and don't belong in the deployed package.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
9 months agodebian: ship info files in the standard location
Daniel Kahn Gillmor [Mon, 9 Dec 2019 18:49:08 +0000 (13:49 -0500)]
debian: ship info files in the standard location

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
9 months agodebian: record upstream files which should not be installed by the package
Daniel Kahn Gillmor [Mon, 9 Dec 2019 18:49:07 +0000 (13:49 -0500)]
debian: record upstream files which should not be installed by the package

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
9 months agodebian: Remove python2 detritus
Daniel Kahn Gillmor [Wed, 4 Dec 2019 08:47:42 +0000 (03:47 -0500)]
debian: Remove python2 detritus

Since we removed python-notmuch, we do not need to retain this file
any longer.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
9 months agodebian: ship notmuch-setup(1) as a copy of notmuch(1)
Daniel Kahn Gillmor [Wed, 4 Dec 2019 08:47:41 +0000 (03:47 -0500)]
debian: ship notmuch-setup(1) as a copy of notmuch(1)

This was being shipped by "make install", but we weren't shipping it
in the debian package.  Thanks to dh_missing for noticing!

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
9 months agodebian: install notmuch(3) manpage in libnotmuch-dev
Daniel Kahn Gillmor [Wed, 4 Dec 2019 08:47:40 +0000 (03:47 -0500)]
debian: install notmuch(3) manpage in libnotmuch-dev

dh_missing noticed that we are building this manpage but not shipping
it in debian.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
9 months agodebian: ship notmuch-emacs-mua.desktop from "make install" copy
Daniel Kahn Gillmor [Wed, 4 Dec 2019 08:47:39 +0000 (03:47 -0500)]
debian: ship notmuch-emacs-mua.desktop from "make install" copy

This helps dh_missing know what's going on.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
9 months agodebian: return an error if debian snapshot build fails
Daniel Kahn Gillmor [Wed, 4 Dec 2019 08:47:38 +0000 (03:47 -0500)]
debian: return an error if debian snapshot build fails

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
9 months agotest: extend test of attachment warnings
Örjan Ekeberg [Thu, 12 Dec 2019 23:35:36 +0000 (00:35 +0100)]
test: extend test of attachment warnings

Check that attachment warnings are not raised when the word
"attach" only occurs in a forwarded message.

9 months agoemacs: limit search for attachment to stop at first mime-part
Örjan Ekeberg [Thu, 12 Dec 2019 23:35:35 +0000 (00:35 +0100)]
emacs: limit search for attachment to stop at first mime-part

This commit changes the behaviour of notmuch-mua-attachment-check
so that it stops searching for notmuch-mua-attachment-regexp when a
new mime-part is reached.  This avoids false warnings when matching
words occur inside forwarded messages.

9 months agotest: add a known broken test for S/MIME decryption
David Bremner [Mon, 18 Nov 2019 01:58:12 +0000 (21:58 -0400)]
test: add a known broken test for S/MIME decryption

This should serve to clarify this feature is not implimented in
notmuch yet.

9 months agoemacs: Improve the reporting of key activity
David Edmondson [Thu, 12 Sep 2019 01:33:00 +0000 (21:33 -0400)]
emacs: Improve the reporting of key activity

Improve the information provided about key retrieval and key validity.

9 months agoemacs: Add notmuch-crypto-gpg-program and use it
David Edmondson [Thu, 12 Sep 2019 01:32:59 +0000 (21:32 -0400)]
emacs: Add notmuch-crypto-gpg-program and use it

Allow the user to specify the gpg program to use when retrieving keys,
etc., defaulting to the value of `epg-gpg-program'.

9 months agoemacs: Minor refactoring of crypto code
David Edmondson [Thu, 12 Sep 2019 01:32:58 +0000 (21:32 -0400)]
emacs: Minor refactoring of crypto code