]> git.notmuchmail.org Git - notmuch/log
notmuch
4 years 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 years 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 years 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 years 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.

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

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

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

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

4 years 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

4 years 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

4 years 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

4 years 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

4 years 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 = /

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

4 years 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

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

4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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

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

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

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

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

4 years 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'.

4 years 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

4 years agoemacs: Asynchronous retrieval of GPG keys
David Edmondson [Thu, 12 Sep 2019 01:32:57 +0000 (21:32 -0400)]
emacs: Asynchronous retrieval of GPG keys

Rather than blocking emacs while gpg does its' thing, by default run
key retrieval asynchronously, possibly updating the display of the
message on successful completion.

4 years agoconfigure: fix reference to possibly undefined $PKG_CONFIG_PATH
Tomi Ollila [Sun, 17 Nov 2019 21:24:41 +0000 (23:24 +0200)]
configure: fix reference to possibly undefined $PKG_CONFIG_PATH

In case zlib not found by pkg-config(1) the pkg-config information
is resolved by attempting to print ZLIB_VERSION from from zlib
installation if it exists anyway.

If above done successfully compat/zlib.pc is written for forthcoming
pkg-config execution.

Since `set -u` is in effect (since 124a67e96, 2016-05-06),
expanding unset $PKG_CONFIG_PATH (would have) failed whenever tried.

Now it is changed to set as "$PKG_CONFIG_PATH:compat" if PKG_CONFIG_PATH
is set and is non-empty string, plain "compat" otherwise.

4 years agowrap-and-sort -ast
Daniel Kahn Gillmor [Wed, 4 Dec 2019 07:07:49 +0000 (02:07 -0500)]
wrap-and-sort -ast

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 years agoAdd debian/upstream/metadata (for DEP-12)
Daniel Kahn Gillmor [Sun, 10 Nov 2019 17:37:48 +0000 (12:37 -0500)]
Add debian/upstream/metadata (for DEP-12)

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 years agodebian/copyright: use secure git URL
Daniel Kahn Gillmor [Sun, 10 Nov 2019 17:37:47 +0000 (12:37 -0500)]
debian/copyright: use secure git URL

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 years agoRules-Requires-Root: no (we do nothing as root during package build)
Daniel Kahn Gillmor [Sun, 10 Nov 2019 17:37:44 +0000 (12:37 -0500)]
Rules-Requires-Root: no (we do nothing as root during package build)

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 years agoStandards-Version: bump to 4.4.1 (no changes needed)
Daniel Kahn Gillmor [Sun, 10 Nov 2019 17:37:43 +0000 (12:37 -0500)]
Standards-Version: bump to 4.4.1 (no changes needed)

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
4 years agoconfigure: Install zsh completions where zsh will find them.
Oliver Kiddle [Thu, 14 Nov 2019 22:10:50 +0000 (23:10 +0100)]
configure: Install zsh completions where zsh will find them.

Zsh searches in the $fpath array for completion functions. By default
this includes $(prefix)/share/zsh/site-functions but not the existing
value. The prefix for zsh and notmuch isn't guaranteed to be the same
but it normally will be making this a better default for
zsh_completion_dir.

4 years agopython-cffi: use shutil.which
David Bremner [Tue, 26 Nov 2019 00:47:24 +0000 (20:47 -0400)]
python-cffi: use shutil.which

I was supposed to amend the original patch that added this function,
but somehow I botched that. The original version runs, so make an
extra commit for the tidying.

4 years agoMove from _add_message to _index_file API
Floris Bruynooghe [Sun, 17 Nov 2019 19:24:46 +0000 (20:24 +0100)]
Move from _add_message to _index_file API

This moves away from the deprecated notmuch_database_add_message API
and instead uses the notmuch_database_index_file API.  This means
instroducing a class to manage the index options and bumping the
library version requirement to 5.1.

4 years agoRename package to notmuch2
Floris Bruynooghe [Sun, 17 Nov 2019 16:41:35 +0000 (17:41 +0100)]
Rename package to notmuch2

This is based on a previous discussion on the list where this was more
or less seen as the least-bad option.

4 years agoShow which notmuch command and version is being used
Floris Bruynooghe [Sun, 17 Nov 2019 16:41:34 +0000 (17:41 +0100)]
Show which notmuch command and version is being used

This add the notmuch version and absolute path of the binary used
in the pytest header.  This is nice when running the tests
interactively as you get confirmation you're testing the version you
thought you were testing.

4 years agodebian: add python3 dependencies for the new python bindings
David Bremner [Mon, 4 Nov 2019 10:39:50 +0000 (06:39 -0400)]
debian: add python3 dependencies for the new python bindings

These should generally match those in .travis.yml

4 years agoswitch travis to bionic
David Bremner [Mon, 4 Nov 2019 02:09:45 +0000 (22:09 -0400)]
switch travis to bionic

This should solve the problem with pytest versions. Drop the notmuch
PPA, as (hopefully) we don't need those packages in bionic

4 years agotravis: add python3-{cffi,pytest,setuptools}, libpython3-all-dev
David Bremner [Sun, 3 Nov 2019 18:19:26 +0000 (14:19 -0400)]
travis: add python3-{cffi,pytest,setuptools}, libpython3-all-dev

These are needed for building and testing the new python bindings.

4 years agotests: run python-cffi tests
David Bremner [Sun, 20 Oct 2019 02:10:24 +0000 (23:10 -0300)]
tests: run python-cffi tests

The entire python-cffi test suite is considered as a single test at
the level of the notmuch test suite. This might or might not be ideal,
but it gets them run.

4 years agobuild: optionally build python-cffi bindings
David Bremner [Sun, 20 Oct 2019 01:52:56 +0000 (22:52 -0300)]
build: optionally build python-cffi bindings

Put the build product (and tests) in a well known location so that we
can find them e.g. from the tests.

4 years agoconfigure: check for python cffi and pytest modules
David Bremner [Sun, 3 Nov 2019 14:54:10 +0000 (10:54 -0400)]
configure: check for python cffi and pytest modules

This is needed to build the new python bindings, and run their tests.

4 years agobindings/python-cffi: preserve environment for tests
David Bremner [Sun, 3 Nov 2019 13:10:29 +0000 (09:10 -0400)]
bindings/python-cffi: preserve environment for tests

We'll need this e.g. to pass PATH to the pytest tests

Based on the suggested approach in id:87d0eljggj.fsf@powell.devork.be

4 years agoIntroduce CFFI-based python bindings
Floris Bruynooghe [Tue, 8 Oct 2019 21:03:12 +0000 (23:03 +0200)]
Introduce CFFI-based python bindings

This introduces CFFI-based Python3-only bindings.
The bindings aim at:
- Better performance on pypy
- Easier to use Python-C interface
- More "pythonic"
  - The API should not allow invalid operations
  - Use native object protocol where possible
- Memory safety; whatever you do from python, it should not coredump.

4 years agoemacs: bind M-RET to notmuch-tree-from-search-thread
William Casarin [Wed, 13 Nov 2019 22:57:52 +0000 (14:57 -0800)]
emacs: bind M-RET to notmuch-tree-from-search-thread

This is an unbound function that is quite useful. It opens a selected
thread in notmuch-tree from the current search query.

Signed-off-by: William Casarin <jb55@jb55.com>
4 years agoemacs: A prefix argument kills rather than browsing URLs
David Edmondson [Mon, 2 Dec 2019 10:48:05 +0000 (10:48 +0000)]
emacs: A prefix argument kills rather than browsing URLs

In `notmuch-show', the "B" key (notmuch-show-browse-urls) will kill
the URL if called with a prefix argument rather than browsing
directly.

4 years agoMerge tag 'debian/0.29.3-1'
David Bremner [Wed, 27 Nov 2019 12:45:43 +0000 (08:45 -0400)]
Merge tag 'debian/0.29.3-1'

notmuch release 0.29.3-1 for unstable (sid) [dgit]

[dgit distro=debian no-split --quilt=linear]

4 years agodebian: changelog for 0.29.3 0.29.3 archive/debian/0.29.3-1 debian/0.29.3-1
David Bremner [Wed, 27 Nov 2019 12:20:31 +0000 (08:20 -0400)]
debian: changelog for 0.29.3

4 years agomention python 2 changes
David Bremner [Wed, 27 Nov 2019 12:11:53 +0000 (08:11 -0400)]
mention python 2 changes

4 years agoversion: bump to 0.29.3
David Bremner [Wed, 27 Nov 2019 12:06:59 +0000 (08:06 -0400)]
version: bump to 0.29.3

4 years agoNEWS for 0.29.3
David Bremner [Wed, 27 Nov 2019 12:06:15 +0000 (08:06 -0400)]
NEWS for 0.29.3

4 years agonotmuch-dump.c: Fix output file being closed twice
Ralph Seichter [Tue, 23 Jul 2019 20:48:23 +0000 (22:48 +0200)]
notmuch-dump.c: Fix output file being closed twice

Fixed: If the output file for a dump was non-writeable, gzclose_w()
was called twice on the output file handle, resulting in SIGABRT.

(cherry picked from commit 17806ecc955ce0375146ea1df51eae061a72bef8)

4 years agolib: fix memory error in notmuch_config_list_value
David Bremner [Mon, 25 Nov 2019 02:31:34 +0000 (22:31 -0400)]
lib: fix memory error in notmuch_config_list_value

The documentation for notmuch_config_list_key warns that that the
returned value will be destroyed by the next call to
notmuch_config_list_key, but it neglected to mention that calling
notmuch_config_list_value would also destroy it (by calling
notmuch_config_list_key). This is surprising, and caused a use after
free bug in _setup_user_query_fields (first noticed by an OpenBSD
porter, so kudos to the OpenBSD malloc implementation).  This change
fixes that use-after-free bug.

5 years agopython: make some docstrings raw
Jakub Wilk [Wed, 20 Nov 2019 10:46:39 +0000 (11:46 +0100)]
python: make some docstrings raw

Fixes:

    notmuch/message.py:57: DeprecationWarning: invalid escape sequence \s
    notmuch/query.py:155: DeprecationWarning: invalid escape sequence \.
    notmuch/messages.py:89: DeprecationWarning: invalid escape sequence \s

with Python >= 3.6.