summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-05-31debian: changelog for 0.29~rc0-1debian/0.29_rc0-1archive/debian/0.29_rc0-10.29_rc0David Bremner
2019-05-31version: bump to 0.29~rc0David Bremner
2019-05-31mime-node: be clearer about decryptionDaniel Kahn Gillmor
Part 0 of a multipart/encrypted object is GMIME_MULTIPART_ENCRYPTED_VERSION; part 1 is GMIME_MULTIPART_ENCRYPTED_CONTENT. Using the name for what we want describes our intent more clearly than using a magic number in the code. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-29test: update test description.David Bremner
I missed this fix in dkg's revisions.
2019-05-29cli/reply: pull proposed subject line from the message, not the indexDaniel Kahn Gillmor
Protected subject lines were being emitted in reply when the cleartext of documents was indexed. create_reply_message() was pulling the subject line from the index, rather than pulling it from the GMimeMessage object that it already has on hand. This one-line fix to notmuch-reply.c solves that problem, and doesn't cause any additional tests to fail. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-29test: reply (in cli and emacs) should protect indexed sensitive headersDaniel Kahn Gillmor
These tests are currently broken! When a protected subject is indexed in the clear, it leaks in the reply headers :( For emacs, we set up separate tests for when the protected header is indexed in the clear and when it is unindexed. neither case should leak, but the former wasn't tested yet. We will fix the two broken tests in a subsequent patch. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-29test: emacs/show: ensure that protected headers appear as expectedDaniel Kahn Gillmor
This tests notmuch-show; headers appear appropriately based on the setting of notmuch-crypto-process-mime. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-29test: ensure that protected headers appear in notmuch-emacs search as expectedDaniel Kahn Gillmor
We initially test only notmuch-search; tests for other functionality come in different patchsets later. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-29test: try indexing nested messages and protected headersDaniel Kahn Gillmor
We want to make sure that internally-forwarded messages don't end up "bubbling up" when they aren't actually the cryptographic payload. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-29test: after reindexing, only legitimate protected subjects are searchableDaniel Kahn Gillmor
This test scans for all the possible protected headers (including bogus/broken ones) that are present in the protected-headers corpus, trying to make sure that only the ones that are not broken or malformed show up in a search after re-indexing. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-29test: protected headers should work when both encrypted and signed.Daniel Kahn Gillmor
Up to this point, we've tested protected headers on messages that have either been encrypted or signed, but not both. This adds a couple tests of signed+encrypted messages, one where the subject line is masked (outside subject line is "Subject Unavailable") and another where it is not (outside Subject: matches inner Subject:) See the discussion at https://dkg.fifthhorseman.net/blog/e-mail-cryptography.html#protected-headers for more details about the nuances between signed, stripped, and stubbed headers. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-29indexing: record protected subject when indexing cleartextDaniel Kahn Gillmor
When indexing the cleartext of an encrypted message, record any protected subject in the database, which should make it findable and visible in search. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-29cli/reply: ensure encrypted Subject: line does not leak in the clearDaniel Kahn Gillmor
Now that we can decrypt headers, we want to make sure that clients using "notmuch reply" to prepare a reply don't leak cleartext in their subject lines. In particular, the ["reply-headers"]["Subject"] should by default show the external Subject. A replying MUA that intends to protect the Subject line should show the user the Subject from ["original"]["headers"]["Subject"] instead of using ["reply-headers"]["Subject"]. This minor asymmetry with "notmuch show" is intentional. While both tools always render the cleartext subject line when they know it (in ["headers"]["Subject"] for "notmuch show" and in ["original"]["headers"]["Subject"] for "notmuch reply"), "notmuch reply" should never leak something that should stay under encrypted cover in "reply-headers". Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-29test: show cryptographic envelope information for signed mailsDaniel Kahn Gillmor
Make sure that we emit the correct cryptographic envelope status for cleartext signed messages. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-29test: add test for missing external subjectDaniel Kahn Gillmor
Adding another test to ensure that we handle protected headers gracefully when no external subject is present. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-29cli/show: add information about which headers were protectedDaniel Kahn Gillmor
The header-mask member of the per-message crypto object allows a clever UI frontend to mark whether a header was protected (or not). And if it was protected, it contains enough information to show useful detail to an interested user. For example, an MUA could offer a "show what this message's Subject looked like on the wire" feature in expert mode. As before, we only handle Subject for now, but we might be able to handle other headers in the future. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net> Amended by db: tweaked schemata notation.
2019-05-29cli/show: emit payload subject instead of outside subjectDaniel Kahn Gillmor
Correctly fix the two outstanding tests so that the protected (hidden) subject is properly reported. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-29cli/show: add tests for viewing protected headersDaniel Kahn Gillmor
Here we add several variant e-mail messages, some of which have correctly-structured protected headers, and some of which do not. The goal of the tests is to ensure that the right protected subjects get reported. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-29test: new test framework to compare json partsJameson Graef Rollins
This makes it easier to write fairly compact, readable tests of json output, without needing to sanitize away parts that we don't care about. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-29util/crypto: add information about the payload partDaniel Kahn Gillmor
When walking the MIME tree, if we discover that we are at the cryptographic payload, then we would like to record at least the Subject header of the current MIME part. In the future, we might want to record many other headers as well, but for now we will stick with just the Subject. See https://dkg.fifthhorseman.net/blog/e-mail-cryptography.html#cryptographic-envelope for more description of the Cryptographic Payload vs. the Cryptographic Envelope. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-29cli/show: emit headers after emitting bodyDaniel Kahn Gillmor
This paves the way for emitting protected headers after verification and decryption, because it means that the headers will only be emitted after the body has been parsed. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-28NEWS: note parallel test suiteDaniel Kahn Gillmor
2019-05-28NEWS: include information about per-message cryptographic statusDaniel Kahn Gillmor
2019-05-28NEWS: News for my changes for 0.29David Bremner
These could be expanded in future commits.
2019-05-26test: report summary even when abortingDaniel Kahn Gillmor
In certain cases of test suite failure, the summary report was not being printed. In particular, any failure on the parallel test suite, and any aborted test in the serialized test suite would end up hiding the summary. It's better to always show the summary where we can (while preserving the return code). If we do abort due to this high-level failure, though, we should also announce to the user that we're doing so as close to the end of the process as possible, to make it easier to find the problem. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-26NEWS: The minimum supported major version of Emacs is now 24.Tomi Ollila
2019-05-26cli/show: emit new whole-message crypto status outputDaniel Kahn Gillmor
This allows MUAs that don't want to think about per-mime-part cryptographic status to have a simple high-level overview of the message's cryptographic state. Sensibly structured encrypted and/or signed messages will work fine with this. The only requirement for the simplest encryption + signing is that the message have all of its encryption and signing protection (the "cryptographic envelope") in a contiguous set of MIME layers at the very outside of the message itself. This is because messages with some subparts signed or encrypted, but with other subparts with no cryptographic protection is very difficult to reason about, and even harder for the user to make sense of or work with. For further characterization of the Cryptographic Envelope and some of the usability tradeoffs, see here: https://dkg.fifthhorseman.net/blog/e-mail-cryptography.html#cryptographic-envelope
2019-05-26mime-node: track whole-message crypto state while walking the treeDaniel Kahn Gillmor
Deliberately populate the message's cryptographic status while walking the MIME tree from the CLI. Note that the additional numchild argument added to _mime_node_create is a passthrough needed to be able to adequately populate the crypto state object.
2019-05-26cli: expose message-wide crypto status from mime-nodeDaniel Kahn Gillmor
The mime node context (a per-message context) gains a cryptographic status object, and the mime_node_t object itself can return a view on that status to an interested party. The status is not yet populated, and for now we can keep that view read-only, so that it can only be populated/modified during MIME tree traversal.
2019-05-26util/crypto: _notmuch_message_crypto: tracks message-wide crypto stateDaniel Kahn Gillmor
E-mail encryption and signatures reported by notmuch are at the MIME part level. This makes sense in the dirty details, but for users we need to have a per-message conception of the cryptographic state of the e-mail. (see https://dkg.fifthhorseman.net/blog/e-mail-cryptography.html for more discussion of why this is important). The object created in this patch is a useful for tracking the cryptographic state of the underlying message as a whole, based on a depth-first search of the message's MIME structure. This object stores a signature list of the message, but we don't handle it yet. Further patches in this series will make use of the signature list.
2019-05-25emacs: Drop content-free "Unknown signature status" buttonDaniel Kahn Gillmor
When we have not been able to evaluate the signature status of a given MIME part, showing a content-free (and interaction-free) "[ Unknown signature status ]" button doesn't really help the user at all, and takes up valuable screen real-estate. A visual reminder that a given message is *not* signed isn't helpful unless it is always present, in which case we'd want to see "[ Unknown signature status ]" buttons on all messages, even ones that don't have a signing structure, but i don't think we want that. Amended by db to drop the unused initialization of 'label'
2019-05-25test: allow disabling timeout with NOTMUCH_TEST_TIMEOUT=0Daniel Kahn Gillmor
To aid in diagnosing test suite tooling that interacts poorly with coreutils' timeout, it's handy to be able to bypass it entirely. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-25doc: document user header indexing.David Bremner
It's a bit odd that the primary documentation is in notmuch-config, but it is consistent with the "query:" prefix.
2019-05-25lib/database: index user headers.David Bremner
This essentially involves calling _notmuch_message_gen_terms once for each user defined header.
2019-05-25lib: support user prefix names in term generationDavid Bremner
This should not change the indexing process yet as nothing calls _notmuch_message_gen_terms with a user prefix name. On the other hand, it should not break anything either. _notmuch_database_prefix does a linear walk of the list of (built-in) prefixes, followed by a logarithmic time search of the list of user prefixes. The latter is probably not really noticable.
2019-05-25lib: cache user prefixes in database objectDavid Bremner
This will be used to avoid needing a database access to resolve a db prefix from the corresponding UI prefix (e.g. when indexing). Arguably the setup of the separate header map does not belong here, since it is about indexing rather than querying, but we currently don't have any other indexing setup to do.
2019-05-25lib: setup user headers in query parserDavid Bremner
These tests will need to be updated if the Xapian query print/debug format changes.
2019-05-25cli/config: check syntax of user configured field namesDavid Bremner
These restrictions are meant to prevent incompatibilities with the Xapian query parser (which will split at non-word characters) and clashes with future notmuch builtin fields.
2019-05-25cli/config: support user header index configDavid Bremner
We don't do anything with this configuration information information yet, but nonetheless add a couple of regression tests to make sure we don't break standard functionality when we do use the configuration information.
2019-05-25cli/config: refactor _stored_in_dbDavid Bremner
This will make it easier to add other prefixes that are stored in the database, compared to special casing each one as "query." was. This commit also adds the ability to validate keys with a given prefix. This ability will be used in a future commit.
2019-05-25util: add unicode_word_utf8David Bremner
This originally use Xapian::Unicode::is_wordchar, but that forces clients to link directly to libxapian, which seems like it might be busywork if nothing else.
2019-05-23emacs: make notmuch-search-interactive-region obsoleteLeo Vivier
`notmuch-search-interactive-region' was moved to notmuch-lib.el in f3cba19f882471a396a6b6175a709ccd1f6f34a0 and renamed to `notmuch-interactive-region' without making the old function obsolete, thereby breaking user-commands which made use of it. This commit marks the function as obsolete and makes it an alias for the new function.
2019-05-23n_m_remove_indexed_terms: reduce number of Xapian API calls.David Bremner
Previously this functioned scanned every term attached to a given Xapian document. It turns out we know how to read only the terms we need to preserve (and we might have already done so). This commit replaces many calls to Xapian::Document::remove_term with one call to ::clear_terms, and a (typically much smaller) number of calls to ::add_term. Roughly speaking this is based on the assumption that most messages have more text than they have tags. According to the performance test suite, this yields a roughly 40% speedup on "notmuch reindex '*'"
2019-05-23test-lib.sh: colors to test output when parallel(1) is run on ttyTomi Ollila
Done via $COLORS_WITHOUT_TTY environment variable as passing options to commands through parallel(1) does not look trivial. Reorganized color checking in test-lib.sh a bit for this (perhaps were not fully necessary but rest still an improvement): - color checking commands in subshell are not run before arg parsing (args may disable colors with --no-color) - [ -t 1 ] is checked before forking subshell
2019-05-23test-lib.sh: "tidied" emacs_deliver_message ()Tomi Ollila
Added initialization and checking of smtp_dummy_port like it was done with smtp_dummy_pid. Made those function-local variables. One 8 spaces to tab consistency conversion. And last, but definitely not least; while doing above noticed that there were quite a few double-quoted strings where $@ was in the middle of it -- replaced those with $* for robustness ("...$@..." expands params to separate words, "...$*..." params expands to single word).
2019-05-22test: redirect STDIN from /dev/nullTomi Ollila
Without this stdin may be anything that parent process provided for it. Test processes might have tried to read something from it, which would have caused undeterministic behavior. E.g. gdb(1) tries to do tty related ioctls on fd 0 (and fd 1 and fd 2, but those are redirected to 'test.output' before test runs).
2019-05-20configure: make _check_session_keys work with an as-needed linkerDaniel Kahn Gillmor
When using a promiscuous linker, _check_session_keys was working fine. But some OSes (including some versions of Ubuntu) have set their linker to always link in "--as-needed" mode, which means that the order of the objects linked is relevant. If a library is loaded before it is needed, that library will no longer be linked in the final outcome. _check_session_keys.c was failing on those systems. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-20configure: handle TEMP_GPG more robustlyDaniel Kahn Gillmor
We never want ./configure to try to do something with an unassigned variable. So, make the directory $TEMP_GPG at the start of the testing of session-key handling, and clean it up afterwards as long as the directory exists. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-20configure: better error handling on session key check.Daniel Kahn Gillmor
There are a few changes bundled here: * say "No." explicitly if there's a failure. * try to avoid implying that gpgme-config is necessary to build notmuch itself (it's not, though it may be useful if you need to rebuild gmime). * leave _check_session_keys and _check_session_keys.c around if ./configure fails, so that the user can play with it more easily for debugging. * let error messages show when _check_session_keys.c is built. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net> Amended by DB: use command -v instead of which.
2019-05-20test/emacs: revert invalid-from test to pre-86f89385 behaviourDavid Bremner
To the best of my understanding, this original behaviour was what Carl's homebrew parser produced. With commit 86f89385 Austin switched to using GMime (2.6). This produced arguably worse results, but since the input was bad, we could live with it. Now with GMime 3.0 we are getting the original results again, and there is no reason to consider this test broken.