]> git.notmuchmail.org Git - notmuch/log
notmuch
6 years agodebian: bump date of upload 0.26_rc1 debian/0.26_rc1-1
David Bremner [Tue, 2 Jan 2018 01:18:22 +0000 (21:18 -0400)]
debian: bump date of upload

6 years agodoc: add 2018 to copyright year
David Bremner [Tue, 2 Jan 2018 01:17:05 +0000 (21:17 -0400)]
doc: add 2018 to copyright year

6 years agoNEWS: document notmuch-properties(7)
Daniel Kahn Gillmor [Sun, 31 Dec 2017 23:09:30 +0000 (18:09 -0500)]
NEWS: document notmuch-properties(7)

6 years agoNEWS: document notmuch_message_remove_all_properties_with_prefix
Daniel Kahn Gillmor [Sun, 31 Dec 2017 23:09:29 +0000 (18:09 -0500)]
NEWS: document notmuch_message_remove_all_properties_with_prefix

6 years agoNEWS: notmuch {show, reply} --decrypt takes explicit argument
Daniel Kahn Gillmor [Sun, 31 Dec 2017 23:09:28 +0000 (18:09 -0500)]
NEWS: notmuch {show, reply} --decrypt takes explicit argument

6 years agoNEWS: note decrypt_policy in python bindings for index_file
Daniel Kahn Gillmor [Sun, 31 Dec 2017 23:09:27 +0000 (18:09 -0500)]
NEWS: note decrypt_policy in python bindings for index_file

6 years agoNEWS: transition n_d_add_message to n_d_index_file
Daniel Kahn Gillmor [Sun, 31 Dec 2017 23:09:26 +0000 (18:09 -0500)]
NEWS: transition n_d_add_message to n_d_index_file

6 years agoNEWS: cleartext indexing section includes session keys
Daniel Kahn Gillmor [Sun, 31 Dec 2017 23:09:25 +0000 (18:09 -0500)]
NEWS: cleartext indexing section includes session keys

These are part and parcel of the same feature, so include the overview
here.

6 years agoNEWS: Python bindings changes for 0.26
David Bremner [Sat, 30 Dec 2017 15:57:44 +0000 (11:57 -0400)]
NEWS: Python bindings changes for 0.26

These are my own changes, plus those of Florian Klink and Lucas
Hoffmann. Gaute's change fixed a bug that was never in a released
version, so I left it out.

6 years agoNEWS: CLI changes for 0.26
David Bremner [Sat, 30 Dec 2017 15:35:23 +0000 (11:35 -0400)]
NEWS: CLI changes for 0.26

As with the lib changes, these are based on the commits with me as author.

6 years agoNEWS: library changes for 0.26
David Bremner [Sat, 30 Dec 2017 13:50:35 +0000 (09:50 -0400)]
NEWS: library changes for 0.26

These are just "my" changes, as arbited by "git shortlog", which
sometimes lies.

6 years agodebian: minimalist changelog for 0.26~rc1-1
David Bremner [Fri, 29 Dec 2017 20:49:50 +0000 (16:49 -0400)]
debian: minimalist changelog for 0.26~rc1-1

6 years agoversion: bump 0.26~rc1
David Bremner [Fri, 29 Dec 2017 20:48:42 +0000 (16:48 -0400)]
version: bump 0.26~rc1

6 years agocli/reply: make --decrypt take a keyword
Daniel Kahn Gillmor [Tue, 19 Dec 2017 16:40:55 +0000 (11:40 -0500)]
cli/reply: make --decrypt take a keyword

This brings the --decrypt argument to "notmuch reply" into line with
the other --decrypt arguments (in "show", "new", "insert", and
"reindex").  This patch is really just about bringing consistency to
the user interface.

We also use the recommended form in the emacs MUA when replying, and
update test T350 to match.

6 years agocli/show: make --decrypt take a keyword.
Daniel Kahn Gillmor [Tue, 19 Dec 2017 16:40:54 +0000 (11:40 -0500)]
cli/show: make --decrypt take a keyword.

We also expand tab completion for it, update the emacs bindings, and
update T350, T357, and T450 to match.

Make use of the bool-to-keyword backward-compatibility feature.

6 years agocli: some keyword options can be supplied with no argument
Daniel Kahn Gillmor [Mon, 25 Dec 2017 18:42:26 +0000 (14:42 -0400)]
cli: some keyword options can be supplied with no argument

We might change some notmuch command line tools that used to be
booleans into keyword arguments.

In that case, there are some legacy tools that will expect to be able
to do "notmuch foo --bar" instead of "notmuch foo --bar=baz".

This patch makes it possible to support that older API, while
providing a warning and an encouragement to upgrade.

6 years agoNEWS: Add nmbug 0.3 release notes to the notmuch 0.26 section
W. Trevor King [Thu, 28 Dec 2017 18:11:58 +0000 (10:11 -0800)]
NEWS: Add nmbug 0.3 release notes to the notmuch 0.26 section

6 years agonmbug: Bump to version 0.3
W. Trevor King [Thu, 28 Dec 2017 18:11:57 +0000 (10:11 -0800)]
nmbug: Bump to version 0.3

Changes since 0.2:

* Accept failures to unset core.worktree in clone (0a155847,
  2017-10-10, unreleased).
* Use --no-renames in log (f9189a06, 2016-09-26, v0.24).
* Auto-checkout in clone if it wouldn't clobber (7ef3b653, 2017-10-10,
  unreleased).
* Add a 'help' command for folks who don't like --help
  (9d25c97d, 2014-10-03, v0.20).
* Setup a 'config' branch on clone to track origin/config (244f8739,
  2015-03-22, v0.20).  This branch may be consumed by
  notmuch-report(1).
* Only error for invalid diff lines in tags/ (57225988, 2017-10-16,
  unreleased).
* Ignore # comments in 'notmuch dump ...' output (9bbc54bd,
  2016-03-27, v0.22).
* Respect 'expect' in _spawn(..., wait=True) (e263c5b1, 2017-10-10,
  unreleased).
* Update URLs in documentation (554b90b5 and 6a833a6e8, 2016-06-02,
  v0.23).

6 years agodebian: update libnotmuch5.symbols for 0.26 0.26_rc0 debian/0.26_rc0-1
David Bremner [Thu, 28 Dec 2017 14:31:47 +0000 (10:31 -0400)]
debian: update libnotmuch5.symbols for 0.26

Several added symbols, no SONAME bump.

6 years agodebian: changelog stanza for 0.26~rc0-1
David Bremner [Thu, 28 Dec 2017 14:21:54 +0000 (10:21 -0400)]
debian: changelog stanza for 0.26~rc0-1

6 years agoversion: bump to 0.26~rc0
David Bremner [Thu, 28 Dec 2017 14:19:48 +0000 (10:19 -0400)]
version: bump to 0.26~rc0

6 years agomake release archive: common (or no) timestamps
Tomi Ollila [Tue, 12 Dec 2017 06:39:20 +0000 (08:39 +0200)]
make release archive: common (or no) timestamps

The appended file 'version' has the same timestamp as the files added
by `git archive`.

The original file name and time stamp are no longer saved to the
gzip header in resulting $(PACKAGE)-$(VERSION).tar.gz file.

When build environment is close enough to another, this may
provide mutually reproducible release archive files.

6 years agoRevert "lib: add thread subqueries."
David Bremner [Thu, 28 Dec 2017 14:05:55 +0000 (10:05 -0400)]
Revert "lib: add thread subqueries."

This reverts commit 4f5bbaf7e2cecfe5022ba4b28915cccfb7ccb12d.

6 years agopython: remove obsolete debian directory
David Bremner [Sun, 24 Dec 2017 13:58:45 +0000 (09:58 -0400)]
python: remove obsolete debian directory

It is unlikely this still works since it has not been updated since
2010. The python packages for debian are now built by the top level
debian/ packaging.

6 years agolib: add thread subqueries.
David Bremner [Sun, 20 Aug 2017 21:32:40 +0000 (18:32 -0300)]
lib: add thread subqueries.

This change allows queries of the form

 thread:{from:me} and thread:{from:jian} and not thread:{from:dave}

This is still somewhat brute-force, but it's a big improvement over
both the shell script solution and the previous proposal [1], because it
does not build the whole thread structure just generate a
query. A further potential optimization is to replace the calls to
notmuch with more specialized Xapian code; in particular it's not
likely that reading all of the message metadata is a win here.

[1]: id:20170820213240.20526-1-david@tethera.net

6 years agoNEWS: document notmuch reindex
Daniel Kahn Gillmor [Sun, 22 Oct 2017 18:53:35 +0000 (14:53 -0400)]
NEWS: document notmuch reindex

Describe the introduction of the "reindex" subcommand.  This blurb
acknowledges Subject: instability under reindexing when multiple
copies exist (suggesting that this is something that needn't
necessarily hold up a release).

6 years agopython: add decrypt_policy argument to Database.index_file()
Daniel Kahn Gillmor [Tue, 19 Dec 2017 19:08:50 +0000 (14:08 -0500)]
python: add decrypt_policy argument to Database.index_file()

We adopt a pythonic idiom here with an optional argument, rather than
exposing the user to the C indexopts object directly.

This now includes a simple test to ensure that the decrypt_policy
argument works as expected.

6 years agopython: Fix method name in docs
l-m-h@web.de [Fri, 22 Dec 2017 22:26:49 +0000 (23:26 +0100)]
python: Fix method name in docs

Fix a method rename in the docs that was overlooked in
3444c731d27fd42bbbdaae00af6ca48b4525b03b.

6 years agotest: final named query test works regardless of Xapian FieldProcessor
Daniel Kahn Gillmor [Tue, 19 Dec 2017 16:27:39 +0000 (11:27 -0500)]
test: final named query test works regardless of Xapian FieldProcessor

This test passes with older versions of Xapian as well, because
neither query returns any results.

This should resolve the travis build failure at
https://travis-ci.org/notmuch/notmuch/builds/318571658

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
6 years agolib: return "" rather than NULL from notmuch_thread_get_authors
David Bremner [Fri, 15 Dec 2017 02:29:57 +0000 (22:29 -0400)]
lib: return "" rather than NULL from notmuch_thread_get_authors

The current behaviour is at best under-documented. The modified test in
T470-missing-headers.sh previously relied on printf doing the right
thing with NULL, which seems icky.

The use of talloc_strdup here is probably overkill, but it avoids
having to enforce that thread->authors is never mutated outside
_resolve_thread_authors_string.

6 years agotest: retrying lock tests are broken when built against older Xapian
Daniel Kahn Gillmor [Wed, 6 Dec 2017 02:33:24 +0000 (21:33 -0500)]
test: retrying lock tests are broken when built against older Xapian

If we're building against a version of Xapian that doesn't offer
retrying the lock, we should be honest and describe the tests as
broken, rather than marking them as missing a test prerequisite.

missing test prerequisites should be for specific components of the
test harness that are missing, not for the backend library notmuch
uses.

6 years agotest: named query tests are broken when missing Xapian FieldProcessor
Daniel Kahn Gillmor [Wed, 6 Dec 2017 02:33:23 +0000 (21:33 -0500)]
test: named query tests are broken when missing Xapian FieldProcessor

Named queries don't work without Xapian FieldProcessor.  Rather than
silently skipping them, we should explictly mark them as broken when
building against an older version of Xapian.

6 years agotest: searching by absolute date is broken without Xapian FieldProcessor
Daniel Kahn Gillmor [Wed, 6 Dec 2017 02:33:22 +0000 (21:33 -0500)]
test: searching by absolute date is broken without Xapian FieldProcessor

Previously, the test suite had simply silently skipped the absolute
date test if we're using an archaic version of Xapian.  For
correctness, we should instead mark the test as broken.

This also changes from string to numeric comparison when checking
NOMTUCH_HAVE_XAPIAN_FIELD_PROCESSOR for consistency with other tests.

6 years agotest: Add test to unset config items with the python bindings
l-m-h@web.de [Thu, 7 Dec 2017 11:40:51 +0000 (12:40 +0100)]
test: Add test to unset config items with the python bindings

6 years agopython: Rename get_config_list to get_configs
l-m-h@web.de [Thu, 7 Dec 2017 11:40:50 +0000 (12:40 +0100)]
python: Rename get_config_list to get_configs

The old name has a bit of a feeling of hungarian notation.  Also many
generators in the core are named with the suffix "s" to indicate
iterables: dict.items, dict.keys for example.

6 years agotest: Add tests for new python bindings
l-m-h@web.de [Thu, 7 Dec 2017 11:40:49 +0000 (12:40 +0100)]
test: Add tests for new python bindings

The tests where adopted from the tests for the corresponding C functions
in test/T590-libconfig.sh.

6 years agopython: turn get_config_list into a generator
l-m-h@web.de [Thu, 7 Dec 2017 11:40:48 +0000 (12:40 +0100)]
python: turn get_config_list into a generator

This mimics the behaviour of the underlying C function more closely as
it also does not store all values in memory.

6 years agopython: add default arg to get_config_list
l-m-h@web.de [Thu, 7 Dec 2017 11:40:47 +0000 (12:40 +0100)]
python: add default arg to get_config_list

It makes the function a little more intuitive to use and does not
diverge much from the original function signature.

Also an example is added to the docstring.

6 years agopython: add bindings to access config
l-m-h@web.de [Thu, 7 Dec 2017 11:40:46 +0000 (12:40 +0100)]
python: add bindings to access config

The C functions notmuch_database_get_config,
notmuch_database_get_config_list and notmuch_database_set_config are
part of the official C bindings.  So there should also be some python
bindings for them.

Also they are the only way to access the named queries introduced in
b9bf3f44.

The interface of the python functions is designed to be close to the C
functions.

6 years agonmbug: Only error for invalid diff lines in tags/
W. Trevor King [Mon, 16 Oct 2017 18:01:47 +0000 (11:01 -0700)]
nmbug: Only error for invalid diff lines in tags/

Avoid:

  Traceback (most recent call last):
    File "/home/nmbug/bin/nmbug", line 834, in <module>
      args.func(**kwargs)
    File "/home/nmbug/bin/nmbug", line 385, in checkout
      status = get_status()
    File "/home/nmbug/bin/nmbug", line 580, in get_status
      maybe_deleted = _diff_index(index=index, filter='D')
    File "/home/nmbug/bin/nmbug", line 658, in _diff_index
      for id, tag in _unpack_diff_lines(stream=p.stdout):
    File "/home/nmbug/bin/nmbug", line 678, in _unpack_diff_lines
      'Invalid line in diff: {!r}'.format(line.strip()))
  ValueError: Invalid line in diff: u'.mailmap'

With this commit, folks can commit READMEs, .mailmap, etc. to their
nmbug repositories, and 'nmbug diff' and 'status' won't choke on them.
If you want to check for this sort of thing, you can set --log-level
to info or greater.  nmbug will still error if the unrecognized path
is under tags/, since that's more likely to be a user error.

6 years agotest: test regexp based new.ignore
Jani Nikula [Sat, 14 Oct 2017 13:16:28 +0000 (16:16 +0300)]
test: test regexp based new.ignore

Just some basics.

6 years agocli/new: support /<regex>/ in new.ignore
Jani Nikula [Sat, 14 Oct 2017 13:16:27 +0000 (16:16 +0300)]
cli/new: support /<regex>/ in new.ignore

Add support for using /<regex>/ style regular expressions in
new.ignore, mixed with the old style verbatim file and directory
basenames. The regex is matched against the relative path from the
database path.

6 years agodoc: arrange search prefix documentation in a definition list
Jani Nikula [Thu, 2 Nov 2017 20:01:17 +0000 (22:01 +0200)]
doc: arrange search prefix documentation in a definition list

Having first a list of prefixes followed by detailed descriptions was
viable when we didn't have all that many prefixes. Now, arranging the
prefix descriptions in a definition list makes more sense.

While at it, include all the supported prefix forms, especially some
missing regex ones.

6 years agocli: add support for only printing the addresses in notmuch address
Jani Nikula [Thu, 2 Nov 2017 18:44:59 +0000 (20:44 +0200)]
cli: add support for only printing the addresses in notmuch address

The notmuch address output is much more useful for scripts with just
the addresses printed. Support this using the --output=address option.

6 years agotest: expand argument parsing sanity checks
Jani Nikula [Sat, 14 Oct 2017 13:16:08 +0000 (16:16 +0300)]
test: expand argument parsing sanity checks

Test the various boolean formats and --no- prefixed boolean and
keyword flag arguments.

6 years agocli: use the negating boolean support for new and insert --no-hooks
Jani Nikula [Sat, 14 Oct 2017 13:16:07 +0000 (16:16 +0300)]
cli: use the negating boolean support for new and insert --no-hooks

This lets us use the positive hooks variable in code, increasing
clarity.

6 years agocli: add support for --no- prefixed boolean and keyword flag arguments
Jani Nikula [Sat, 14 Oct 2017 13:16:06 +0000 (16:16 +0300)]
cli: add support for --no- prefixed boolean and keyword flag arguments

Add transparent support for negating boolean and keyword flag
arguments using --no-argument style on the command line. That is, if
the option description contains a boolean or a keyword flag argument
named "argument", --no-argument will match and negate it.

For boolean arguments this obviously means the logical NOT. For
keyword flag arguments this means bitwise AND of the bitwise NOT,
i.e. masking out the specified bits instead of OR'ing them in.

For example, you can use --no-exclude instead of --exclude=false in
notmuch show. If we had keyword flag arguments with some flags
defaulting to on, say --include=tags in notmuch dump/restore, this
would allow --no-include=tags to switch that off while not affecting
other flags.

As a curiosity, you should be able to warp your brain using
--no-exclude=true meaning false and --no-exclude=false meaning true if
you wish.

Specifying both "argument" and "no-argument" style arguments in the
same option description should be avoided. In this case, --no-argument
would match whichever is specified first, and --argument would only
match "argument".

6 years agoStandards-Version: bumped to 4.1.2 (no changes needed)
Daniel Kahn Gillmor [Mon, 11 Dec 2017 23:45:14 +0000 (18:45 -0500)]
Standards-Version: bumped to 4.1.2 (no changes needed)

6 years agocli/help,completion: added pointers to notmuch-properties(7)
Daniel Kahn Gillmor [Thu, 26 Oct 2017 21:28:12 +0000 (17:28 -0400)]
cli/help,completion: added pointers to notmuch-properties(7)

6 years agonmbug: Auto-checkout in clone if it wouldn't clobber
W. Trevor King [Tue, 10 Oct 2017 22:49:51 +0000 (15:49 -0700)]
nmbug: Auto-checkout in clone if it wouldn't clobber

We currently auto-checkout after pull and merge to make those more
convenient.  They're guarded against data-loss with a leading
_insist_committed().  This commit adds the same convenience to clone,
since in most cases users will have no NMBPREFIX-prefixed tags in
their database when they clone.  Users that *do* have
NMBPREFIX-prefixed tags will get a warning (and I've bumped the
default log level to warning so folks who don't set --log-level will
see it) like:

  $ nmbug clone http://nmbug.notmuchmail.org/git/nmbug-tags.git
  Cloning into '/tmp/nmbug-clone.g9dvd0tv'...
  Checking connectivity: 16674, done.
  Branch config set up to track remote branch config from origin.
  Not checking out to avoid clobbering existing tags: notmuch::0.25, ...

6 years agonmbug: Accept failures to unset core.worktree in clone
W. Trevor King [Tue, 10 Oct 2017 22:49:50 +0000 (15:49 -0700)]
nmbug: Accept failures to unset core.worktree in clone

Since 6311cfaf (init: do not set unnecessary core.worktree,
2016-09-25, 2.11.0 [1]), Git has no longer set core.worktree when
--separate-git-dir is used.  This broke clone with:

  $ nmbug clone http://nmbug.notmuchmail.org/git/nmbug-tags.git
  Cloning into '/tmp/nmbug-clone.33gg442e'...
  Checking connectivity: 16674, done.
  ['git', '--git-dir', '/home/wking/.nmbug', 'config', '--unset', 'core.worktree'] exited with 5
  $ echo $?
  1

The initial discussion that lead to the Git change is in [2], and
there is some more discussion around this specific change in [3].
There is some useful background on working trees in this 2009 message
[4].  There is also a git-worktree(1) since df0b6cfb (worktree: new
place for "git prune --worktrees", 2015-06-29, 2.5.0 [5]) which grew
the ability to add new worktrees in 799767cc (Merge branch
'es/worktree-add', 2015-07-13, 2.5.0 [6]).  Folks relying on
core.worktree in the --separate-git-dir case fall into the "former
case" in [4], and as Junio pointed out in that message, Git
operations like 'add' don't really work there.

In nmbug we don't want core.worktree, because our effective working
tree is the notmuch database.  By accepting failed core.worktree
unsets, clone will work with Gits older and younger than 2.11.0.

[1]: https://github.com/git/git/commit/6311cfaf93716bcc43dd1151cb1763e3f80d8099
[2]: https://public-inbox.org/git/CALqjkKZO_y0DNcRJjooyZ7Eso7yBMGhvZ6fE92oO4Su7JeCeng@mail.gmail.com/
[3]: https://public-inbox.org/git/87h94d8cwi.fsf@kyleam.com/
[4]: https://public-inbox.org/git/7viqbsw2vn.fsf@alter.siamese.dyndns.org/
[5]: https://github.com/git/git/commit/df0b6cfbda88144714541664fb501146d6465a82
[6]: https://github.com/git/git/commit/799767cc98b2f8e6f82d0de4bef9b5e8fcc16e97

Reported-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
6 years agonmbug: Respect 'expect' in _spawn(..., wait=True)
W. Trevor King [Tue, 10 Oct 2017 22:49:49 +0000 (15:49 -0700)]
nmbug: Respect 'expect' in _spawn(..., wait=True)

Fixing a bug from 7f2cb3be (nmbug: Translate to Python, 2014-10-03).
The bug had no direct impact though, because none of the wait=True
callers were setting expect.

Also add expected codes to the debug messages, to help log readers
understand why nonzero exits are occasionally accepted.

6 years agoMerge branch 'release'
David Bremner [Sat, 9 Dec 2017 02:19:06 +0000 (22:19 -0400)]
Merge branch 'release'

Conflicts:
        NEWS

Add in NEWS from point release

6 years agodebian: add changelog stanza for 0.25.3-1 0.25.3
David Bremner [Sat, 9 Dec 2017 01:08:21 +0000 (21:08 -0400)]
debian: add changelog stanza for 0.25.3-1

6 years agodebian: disable gdb on alpha
David Bremner [Sat, 9 Dec 2017 01:05:25 +0000 (21:05 -0400)]
debian: disable gdb on alpha

gdb seems to be broken on more architectures than it works :(.

6 years agoINSTALL: suggest gmime-3.x
David Bremner [Sat, 9 Dec 2017 01:01:17 +0000 (21:01 -0400)]
INSTALL: suggest gmime-3.x

Since we deprecated support for GMime 2.6...

6 years agodebian: add versioned depends on libgmime
David Bremner [Sat, 9 Dec 2017 00:59:45 +0000 (20:59 -0400)]
debian: add versioned depends on libgmime

6 years agoNEWS: news for 0.25.3
David Bremner [Sat, 9 Dec 2017 00:56:02 +0000 (20:56 -0400)]
NEWS: news for 0.25.3

6 years agoversion: bump to 0.25.3
David Bremner [Sat, 9 Dec 2017 00:47:25 +0000 (20:47 -0400)]
version: bump to 0.25.3

6 years agotest/emacs: add exploit mitigation test
David Bremner [Wed, 6 Dec 2017 01:17:58 +0000 (21:17 -0400)]
test/emacs: add exploit mitigation test

This test will pass if either the notmuch show mitigation code is
working correctly, or upstream emacs mime handling code has it's own
fix for https://bugs.gnu.org/28350.

6 years agoemacs: letf enriched-decode-display-prop for text/enriched display
Tomi Ollila [Wed, 6 Dec 2017 01:17:57 +0000 (21:17 -0400)]
emacs: letf enriched-decode-display-prop for text/enriched display

Dynamically bind enriched-decode-display-prop when inserting
text/enriched part. This complements commit 9b0582383833 for
emacs versions before 24.4 which do not have advice-add
functionality.

Since emacs 25.3 this particular bug is fixed.

6 years agocrypto: signature verification reports valid User IDs
Daniel Kahn Gillmor [Fri, 8 Dec 2017 20:09:46 +0000 (15:09 -0500)]
crypto: signature verification reports valid User IDs

When i'm trying to understand a message signature, i care that i know
who it came from (the "validity" of the identity associated with the
key), *not* whether i'm willing to accept the keyholder's other
identity assertions (the "trust" associated with the certificate).

We've been reporting User ID information based on the "trust"
associated with the certificate, because GMime didn't clearly expose
the validity of the User IDs.

This change relies on fixes made in GMime 3.0.3 and later which
include https://github.com/jstedfast/gmime/pull/18.

6 years agodocs: clean up documentation about decryption policies
Daniel Kahn Gillmor [Fri, 8 Dec 2017 06:24:03 +0000 (01:24 -0500)]
docs: clean up documentation about decryption policies

Now that the range of sensible decryption policies has come into full
view, we take a bit of space to document the distinctions.

Most people will use either "auto" or "true" -- but we provide "false"
and "nostash" to handle use cases that might reasonably be requested.

Note also that these can be combined in sensible ways.  Like, if your
mail comes in regularly to a service that doesn't have access to your
secret keys, but does have access to your index, and you feel
comfortable adding selected encrypted messages to the index after
you've read them, you could stay in "auto" normally, and then when you
find yourself reading an indexable message (e.g. one you want to be
able to search for in the future, and that you don't mind exposing to
whatever entities have access to your inde), you can do:

    notmuch reindex --decrypt=true id:whatever@example.biz

That leaves your default the same (still "auto") but you get the
cleartext index and stashed session key benefits for that particular
message.

6 years agocrypto: add --decrypt=nostash to avoid stashing session keys
Daniel Kahn Gillmor [Fri, 8 Dec 2017 06:24:02 +0000 (01:24 -0500)]
crypto: add --decrypt=nostash to avoid stashing session keys

Here's the configuration choice for people who want a cleartext index,
but don't want stashed session keys.

Interestingly, this "nostash" decryption policy is actually the same
policy that should be used by "notmuch show" and "notmuch reply",
since they never modify the index or database when they are invoked
with --decrypt.

We take advantage of this parallel to tune the behavior of those
programs so that we're not requesting session keys from GnuPG during
"show" and "reply" that we would then otherwise just throw away.

6 years agocrypto: actually stash session keys when decrypt=true
Daniel Kahn Gillmor [Fri, 8 Dec 2017 06:24:01 +0000 (01:24 -0500)]
crypto: actually stash session keys when decrypt=true

If you're going to store the cleartext index of an encrypted message,
in most situations you might just as well store the session key.
Doing this storage has efficiency and recoverability advantages.

Combined with a schedule of regular OpenPGP subkey rotation and
destruction, this can also offer security benefits, like "deletable
e-mail", which is the store-and-forward analog to "forward secrecy".

But wait, i hear you saying, i have a special need to store cleartext
indexes but it's really bad for me to store session keys!  Maybe
(let's imagine) i get lots of e-mails with incriminating photos
attached, and i want to be able to search for them by the text in the
e-mail, but i don't want someone with access to the index to be
actually able to see the photos themselves.

Fret not, the next patch in this series will support your wacky
uncommon use case.

6 years agocli/reindex: destroy stashed session keys when --decrypt=false
Daniel Kahn Gillmor [Fri, 8 Dec 2017 06:24:00 +0000 (01:24 -0500)]
cli/reindex: destroy stashed session keys when --decrypt=false

There are some situations where the user wants to get rid of the
cleartext index of a message.  For example, if they're indexing
encrypted messages normally, but suddenly they run across a message
that they really don't want any trace of in their index.

In that case, the natural thing to do is:

   notmuch reindex --decrypt=false id:whatever@example.biz

But of course, clearing the cleartext index without clearing the
stashed session key is just silly.  So we do the expected thing and
also destroy any stashed session keys while we're destroying the index
of the cleartext.

Note that stashed session keys are stored in the xapian database, but
xapian does not currently allow safe deletion (see
https://trac.xapian.org/ticket/742).

As a workaround, after removing session keys and cleartext material
from the database, the user probably should do something like "notmuch
compact" to try to purge whatever recoverable data is left in the
xapian freelist.  This problem really needs to be addressed within
xapian, though, if we want it fixed right.

6 years agocli/new, insert, reindex: change index.decrypt to "auto" by default
Daniel Kahn Gillmor [Fri, 8 Dec 2017 06:23:59 +0000 (01:23 -0500)]
cli/new, insert, reindex: change index.decrypt to "auto" by default

The new "auto" decryption policy is not only good for "notmuch show"
and "notmuch reindex".  It's also useful for indexing messages --
there's no good reason to not try to go ahead and index the cleartext
of a message that we have a stashed session key for.

This change updates the defaults and tunes the test suite to make sure
that they have taken effect.

6 years agocrypto: record whether an actual decryption attempt happened
Daniel Kahn Gillmor [Fri, 8 Dec 2017 06:23:58 +0000 (01:23 -0500)]
crypto: record whether an actual decryption attempt happened

In our consolidation of _notmuch_crypto_decrypt, the callers lost
track a little bit of whether any actual decryption was attempted.

Now that we have the more-subtle "auto" policy, it's possible that
_notmuch_crypto_decrypt could be called without having any actual
decryption take place.

This change lets the callers be a little bit smarter about whether or
not any decryption was actually attempted.

6 years agocli/new, insert, reindex: update documentation for --decrypt=auto
Daniel Kahn Gillmor [Fri, 8 Dec 2017 06:23:57 +0000 (01:23 -0500)]
cli/new, insert, reindex: update documentation for --decrypt=auto

we also include --decrypt=auto in the tab completion.

6 years agocli/show, reply: document use of stashed session keys in notmuch-properties
Daniel Kahn Gillmor [Fri, 8 Dec 2017 06:23:56 +0000 (01:23 -0500)]
cli/show, reply: document use of stashed session keys in notmuch-properties

The stashed session keys are stored internally as notmuch properties.
So a user or developer who is reading about those properties might
want to understand how they fit into the bigger picture.

Note here that decrypting with a stored session key no longer needs
-decrypt for "notmuch show" and "notmuch reply".

6 years agocli/show: use decryption policy "auto" by default.
Daniel Kahn Gillmor [Fri, 8 Dec 2017 06:23:55 +0000 (01:23 -0500)]
cli/show: use decryption policy "auto" by default.

When showing a message, if the user doesn't specify --decrypt= at all,
but a stashed session key is known to notmuch, notmuch should just go
ahead and try to decrypt the message with the session key (without
bothering the user for access to their asymmetric secret key).

The user can disable this at the command line with --decrypt=false if
they really don't want to look at the e-mail that they've asked
notmuch to show them.

and of course, "notmuch show --decrypt" still works for accessing the
user's secret keys if necessary.

6 years agocli/reply: use decryption policy "auto" by default.
Daniel Kahn Gillmor [Fri, 8 Dec 2017 06:23:54 +0000 (01:23 -0500)]
cli/reply: use decryption policy "auto" by default.

If the user doesn't specify --decrypt= at all, but a stashed session
key is known to notmuch, when replying to an encrypted message,
notmuch should just go ahead and decrypt.

The user can disable this at the command line with --decrypt=false,
though it's not clear why they would ever want to do that.

6 years agocrypto: new decryption policy "auto"
Daniel Kahn Gillmor [Fri, 8 Dec 2017 06:23:53 +0000 (01:23 -0500)]
crypto: new decryption policy "auto"

This new automatic decryption policy should make it possible to
decrypt messages that we have stashed session keys for, without
incurring a call to the user's asymmetric keys.

6 years agolib: convert notmuch decryption policy to an enum
Daniel Kahn Gillmor [Fri, 8 Dec 2017 06:23:52 +0000 (01:23 -0500)]
lib: convert notmuch decryption policy to an enum

Future patches in this series will introduce new policies; this merely
readies the way for them.

We also convert --try-decrypt to a keyword argument instead of a boolean.

6 years agoindexopts: change _try_decrypt to _decrypt_policy
Daniel Kahn Gillmor [Fri, 8 Dec 2017 06:23:51 +0000 (01:23 -0500)]
indexopts: change _try_decrypt to _decrypt_policy

This terminology makes it clearer what's going on at the API layer,
and paves the way for future changesets that offer more nuanced
decryption policy.

6 years agoindexing: Change from try_decrypt to decrypt
Daniel Kahn Gillmor [Fri, 8 Dec 2017 06:23:50 +0000 (01:23 -0500)]
indexing: Change from try_decrypt to decrypt

the command-line interface for indexing (reindex, new, insert) used
--try-decrypt; and the configuration records used index.try_decrypt.
But by comparison with "show" and "reply", there doesn't seem to be
any reason for the "try" prefix.

This changeset adjusts the command-line interface and the
configuration interface.

For the moment, i've left indexopts_{set,get}_try_decrypt alone.  The
subsequent changeset will address those.

6 years agocli/help: give a hint about notmuch-emacs-mua
Daniel Kahn Gillmor [Mon, 4 Dec 2017 18:43:10 +0000 (13:43 -0500)]
cli/help: give a hint about notmuch-emacs-mua

"notmuch help" doesn't mention "notmuch-emacs-mua" even though we
support it through the try_external_command() mechanism.

In addition, "notmuch help emacs-mua" doesn't work, even though we
ship the appropriate manpage.

This changeset fixes both of these problems.

6 years agodebian/control: build-depend on python3-sphinx instead of python-sphinx
Daniel Kahn Gillmor [Wed, 6 Dec 2017 01:46:55 +0000 (20:46 -0500)]
debian/control: build-depend on python3-sphinx instead of python-sphinx

python2 is going to be deprecated, and python3-sphinx is available all
the way back to oldoldstable.  let's use the more modern version.

To make this work and still ship the manpages, tell ./configure to
prefer python3 over python, if it exists.

6 years agotest: session keys are known broken without session key support
Daniel Kahn Gillmor [Tue, 5 Dec 2017 18:40:27 +0000 (13:40 -0500)]
test: session keys are known broken without session key support

If the version of GMime we're building against doesn't support session
key extraction or re-use, mark the tests that rely on session key
capabilities as known-broken.

This should resolve test suite failures on ubuntu trusty and debian
jessie and earlier, which have GMime 2.6.20 -- session key support was
introduced in GMime 2.6.21.

6 years agocrypto: Test restore of cleartext index from stashed session keys
Daniel Kahn Gillmor [Thu, 30 Nov 2017 08:59:31 +0000 (03:59 -0500)]
crypto: Test restore of cleartext index from stashed session keys

If you've got a notmuch dump that includes stashed session keys for
every decrypted message, and you've got your message archive, you
should be able to get back to the same index that you had before.

Here we add a simple test that give some flavor of how that works.

6 years agotest/corpora: add an encrypted message for index decryption tests
Daniel Kahn Gillmor [Thu, 30 Nov 2017 08:59:30 +0000 (03:59 -0500)]
test/corpora: add an encrypted message for index decryption tests

6 years agocrypto: use stashed session-key properties for decryption, if available
Daniel Kahn Gillmor [Thu, 30 Nov 2017 08:59:29 +0000 (03:59 -0500)]
crypto: use stashed session-key properties for decryption, if available

When doing any decryption, if the notmuch database knows of any
session keys associated with the message in question, try them before
defaulting to using default symmetric crypto.

This changeset does the primary work in _notmuch_crypto_decrypt, which
grows some new parameters to handle it.

The primary advantage this patch offers is a significant speedup when
rendering large encrypted threads ("notmuch show") if session keys
happen to be cached.

Additionally, it permits message composition without access to
asymmetric secret keys ("notmuch reply"); and it permits recovering a
cleartext index when reindexing after a "notmuch restore" for those
messages that already have a session key stored.

Note that we may try multiple decryptions here (e.g. if there are
multiple session keys in the database), but we will ignore and throw
away all the GMime errors except for those that come from last
decryption attempt.  Since we don't necessarily know at the time of
the decryption that this *is* the last decryption attempt, we'll ask
for the errors each time anyway.

This does nothing if no session keys are stashed in the database,
which is fine.  Actually stashing session keys in the database will
come as a subsequent patch.

6 years agoconfigure: session key handling in gmime maps to built_with("session_key")
Daniel Kahn Gillmor [Thu, 30 Nov 2017 08:59:28 +0000 (03:59 -0500)]
configure: session key handling in gmime maps to built_with("session_key")

This flag should make it easier to write the code for session-key
handling.

Note that this only works for GMime 2.6.21 and later (the session key
interface wasn't available before then).  It should be fine to build
the rest of notmuch if this functionality isn't available.

Note that this also adds the "session_key" built_with() aspect to
libnotmuch.

6 years agocrypto: add _notmuch_crypto_decrypt wrapper function
Daniel Kahn Gillmor [Thu, 30 Nov 2017 08:59:27 +0000 (03:59 -0500)]
crypto: add _notmuch_crypto_decrypt wrapper function

We will use this centralized function to consolidate the awkward
behavior around different gmime versions.

It's only invoked from two places: mime-node.c's
node_decrypt_and_verify() and lib/index.cc's
_index_encrypted_mime_part().

However, those two places have some markedly distinct logic, so the
interface for this _notmuch_crypto_decrypt function is going to get a
little bit clunky.  It's worthwhile, though, for the sake of keeping
these #if directives reasonably well-contained.

6 years agomime-node: handle decrypt_result more safely
Daniel Kahn Gillmor [Thu, 30 Nov 2017 08:59:26 +0000 (03:59 -0500)]
mime-node: handle decrypt_result more safely

If (for whatever reason) we don't get a decrypt_result back, or it's
not structured the way we expect it to be, we shouldn't choke on it.

6 years agodebian: bump Standards-Version to 4.1.1
Daniel Kahn Gillmor [Thu, 30 Nov 2017 09:40:42 +0000 (04:40 -0500)]
debian: bump Standards-Version to 4.1.1

No minor changes were necessary to become compliant with Debian policy
version 4.1.1, so this is basically a freebie.

6 years agodebian/control: Priority: extra is deprecated
Daniel Kahn Gillmor [Thu, 30 Nov 2017 09:40:41 +0000 (04:40 -0500)]
debian/control: Priority: extra is deprecated

Move transitional package to to "oldlibs/optional"

This resolves two lintian warnings:

W: notmuch-emacs: transitional-package-should-be-oldlibs-optional oldlibs/extra
W: notmuch-emacs: priority-extra-is-replaced-by-priority-optional

6 years agodebian/changelog: remove trailing whitespace
Daniel Kahn Gillmor [Thu, 30 Nov 2017 09:40:40 +0000 (04:40 -0500)]
debian/changelog: remove trailing whitespace

6 years agotest: unbreak performance tests
David Bremner [Sat, 2 Dec 2017 12:53:04 +0000 (08:53 -0400)]
test: unbreak performance tests

In 8e7fb88237aedea22 Jani replaced the use of $(pwd -P) to find the
TEST_DIRECTORY in order to better support out of tree
builds. Unfortunately the performance-tests need a different value for
the variable and were thus broken.

This commit splits out the setting of this variable for the two sets
of tests.  Performance tests still don't work out of tree, because
the handling of the downloaded corpus needs to be updated.

6 years agotest: test notmuch insert --folder=""
Jani Nikula [Thu, 2 Nov 2017 19:08:57 +0000 (21:08 +0200)]
test: test notmuch insert --folder=""

Test insert into top level folder.

6 years agocli: allow empty strings for notmuch insert --folder argument
Jani Nikula [Sat, 14 Oct 2017 13:15:43 +0000 (16:15 +0300)]
cli: allow empty strings for notmuch insert --folder argument

Now that it's easy to add argument specific modifiers in opt
descriptions, add a new .allow_empty field to allow empty strings for
individual string arguments while retaining strict checks
elsewhere. Use this for notmuch insert --folder, where the empty
string means top level folder.

6 years agoMerge branch 'release'
David Bremner [Mon, 6 Nov 2017 00:25:54 +0000 (20:25 -0400)]
Merge branch 'release'

Changes from 0.25.2 release

6 years agodebian: changelog for 0.25.2-1 0.25.2 debian/0.25.2-1
David Bremner [Mon, 6 Nov 2017 00:06:23 +0000 (20:06 -0400)]
debian: changelog for 0.25.2-1

6 years agoversion: bump to 0.25.2
David Bremner [Sun, 5 Nov 2017 23:59:30 +0000 (19:59 -0400)]
version: bump to 0.25.2

6 years agoNEWS for 0.25.2
David Bremner [Sun, 5 Nov 2017 23:54:40 +0000 (19:54 -0400)]
NEWS for 0.25.2

6 years agocli/crypto: fix segfault on failed gmime2 crypto context creation
Jani Nikula [Mon, 16 Oct 2017 15:40:44 +0000 (18:40 +0300)]
cli/crypto: fix segfault on failed gmime2 crypto context creation

Commit 1fdc08d0ffab ("cli/crypto: treat failure to create a crypto
context as fatal.") started treating crypto context creation failures
"as fatal", returning NULL from _mime_node_create().

Unfortunately, we do not have NULL checks for _mime_node_create()
failures. The only caller, mime_node_child(), could check and return
NULL (as it's documented to do on errors) but none of the several call
sites have NULL checks either. And none of them really have a trivial
but feasible and graceful way of recovery.

So while the right thing to do would be to handle NULL returns
properly all over the place, and we have other scenarios that do
return NULL from above mentioned functions, the crypto context
creation failure is something that does seem to show up regularly in
some scenarios, revert back to the functionality before commit
1fdc08d0ffab as an interim fix.

6 years agotest: fix test database backup/restore location
Jani Nikula [Tue, 24 Oct 2017 18:36:11 +0000 (21:36 +0300)]
test: fix test database backup/restore location

backup_database() and restore_database() used to store the backups in
the test specific temporary directory, through the current working
directory being there. Commit 8e7fb88237ae ("test: use source and
build paths in test-lib-common.sh") started using a test specific
backup directories under the build tree test directory. This was in
error. Switch back to the old location, but using paths to the
location instead of relying on current working directory.

Reported by Daniel Kahn Gillmor <dkg@fifthhorseman.net>.

6 years agoNEWS: cleartext indexing
Daniel Kahn Gillmor [Sun, 22 Oct 2017 15:36:34 +0000 (11:36 -0400)]
NEWS: cleartext indexing

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

6 years agoNEWS: test suite out-of-tree builds
Jani Nikula [Sat, 21 Oct 2017 19:53:28 +0000 (22:53 +0300)]
NEWS: test suite out-of-tree builds

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

6 years agocli/reindex: add --try-decrypt=(true|false)
Daniel Kahn Gillmor [Sat, 21 Oct 2017 02:25:48 +0000 (22:25 -0400)]
cli/reindex: add --try-decrypt=(true|false)

Enable override of the index.try_decrypt setting on a per-run basis
when invoking "notmuch reindex".  This allows the possibility of (for
example) an emacs keybinding that adds the cleartext of the currently
shown decrypted message to the index, making it searchable in the
future.

It also enables one-time indexing of all messages matching some query,
like so:

    notmuch reindex tag:encrypted and\
       not property:index.decryption=success and\
       from:alice@example.org

We also update the documentation and tab completion, and add a few
more tests.