aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-11-27debian: changelog for 0.29.3debian/0.29.3-1archive/debian/0.29.3-10.29.3David Bremner
2019-11-27mention python 2 changesDavid Bremner
2019-11-27version: bump to 0.29.3David Bremner
2019-11-27NEWS for 0.29.3David Bremner
2019-11-27notmuch-dump.c: Fix output file being closed twiceRalph Seichter
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)
2019-11-27lib: fix memory error in notmuch_config_list_valueDavid Bremner
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.
2019-11-20python: make some docstrings rawJakub Wilk
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.
2019-11-03Merge tag 'debian/0.29.2-2'David Bremner
notmuch release 0.29.2-2 for experimental (experimental) [dgit] [dgit distro=debian no-split --quilt=linear]
2019-11-02debian upload 0.29.2-2: goodbye python2 supportdebian/0.29.2-2archive/debian/0.29.2-2David Bremner
Convert to pybuild while we are at it.
2019-10-19Merge tag '0.29.2'David Bremner
notmuch 0.29.2 release
2019-10-19update NEWS for 0.29.2debian/0.29.2-1archive/debian/0.29.2-10.29.2David Bremner
2019-10-19Changelog stanza for 0.29.2-1David Bremner
2019-10-19bump versionDavid Bremner
2019-10-13Drop devel/printmimestructure (it is in mailscripts 0.11)Daniel Kahn Gillmor
mailscripts 0.11 now ships a derivative of devel/printmimestructure called email-print-mime-structure. Maintenance for that utility will happen in mailscripts from now on, so we should not track an independent copy of it in notmuch's source tree. See https://bugs.debian.org/939993 for more details about the adoption. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-10-13Merge branch 'release'David Bremner
2019-10-13util: whitespace cleanup for 4c5b17b1David Bremner
Oops. This should make the merge back to master smoother.
2019-10-12util: unreference objects referenced by the returned stream objDavid Bremner
We want freeing the returned stream to also free these underlying objects. Compare tests/test-filters.c in the gmime 3.2.x source, which uses this same idiom. Thanks to James Troup for the report and the fix.
2019-10-12test: known broken test file descriptor leak in gzip file openDavid Bremner
James Troup reported this bug in id:87pnjsf9q5.fsf@canonical.com
2019-09-23Merge branch 'release'David Bremner
2019-09-23remove stray ` from NEWSDavid Bremner
2019-09-15cli/{show,reply}: use repaired form of "Mixed Up" mangled messagesDaniel Kahn Gillmor
When showing or replying to a message that has been mangled in transit by an MTA in the "Mixed up" way, notmuch should instead use the repaired form of the message. Tracking the repaired GMimeObject for the lifetime of the mime_node so that it is cleaned up properly is probably the trickiest part of this patch, but the choices here are based on the idea that the mime_node_context is the memory manager for the whole mime_node tree in the first place, so new GMimeObject tree created on-the-fly during message parsing should be disposed of in the same place. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-09-15index: repair "Mixed Up" messages before indexing.Daniel Kahn Gillmor
When encountering a message that has been mangled in the "mixed up" way by an intermediate MTA, notmuch should instead repair it and index the repaired form. When it does this, it also associates the index.repaired=mixedup property with the message. If a problem is found with this repair process, or an improved repair process is proposed later, this should make it easy for people to reindex the relevant message. The property will also hopefully make it easier to diagnose this particular problem in the future. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-09-15util/repair: identify and repair "Mixed Up" mangled messagesDaniel Kahn Gillmor
Implement a functional identification and repair process for "Mixed Up" MIME messages as described in https://tools.ietf.org/html/draft-dkg-openpgp-pgpmime-message-mangling-00#section-4.1 The detection test is not entirely complete, in that it does not verify the contents of the latter two message subparts, but this is probably safe to skip, because those two parts are unlikely to be readable anyway, and the only part we are effectively omitting (the first subpart) is guaranteed to be empty anyway, so its removal can be reversed if you want to do so. I've left FIXMEs in the code so that anyone excited about adding these additional checks can see where to put them in. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-09-15test: add test for "Mixed-Up Mime" message manglingDaniel Kahn Gillmor
Some MTAs mangle e-mail messages in transit in ways that are repairable. Microsoft Exchange (in particular, the version running today on Office365's mailservers) appears to mangle multipart/encrypted messages in a way that makes them undecryptable by the recipient. I've documented this in section 4.1 "Mixed-up encryption" of draft -00 of https://tools.ietf.org/html/draft-dkg-openpgp-pgpmime-message-mangling Fortunately, it's possible to repair such a message, and notmuch can do that so that a user who receives an encrypted message from a user of office365.com can still decrypt the message. Enigmail already knows about this particular kind of mangling. It describes it as "broken PGP email format probably caused by an old Exchange server", and it tries to repair by directly changing the message held by the user. if this kind of repair goes wrong, the repair process can cause data loss (https://sourceforge.net/p/enigmail/bugs/987/, yikes). The tests introduced here are currently broken. In subsequent patches, i'll introduce a non-destructive form of repair for notmuch so that notmuch users can read mail that has been mangled in this way, and the tests will succeed. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-09-11configure: disallow whitespace in paths, extend checks to $PWDTomi Ollila
Whitespace in $NOTMUCH_SRCDIR (and $PWD) may work in builds, but definitely will not work in tests. It would be difficult to make tests support whitespace in test filename paths -- and fragile to maintain if done. So it is just easier and safer to disallow whitespace there. In case of out of tree build $NOTMUCH_SRCDIR differs from $PWD (current directory). Extend this whitespace, and also previously made unsafe characters check to $PWD too.
2019-09-01index: avoid indexing legacy-display partsDaniel Kahn Gillmor
When we notice a legacy-display part during indexing, it makes more sense to avoid indexing it as part of the message body. Given that the protected subject will already be indexed, there is no need to index this part at all, so we skip over it. If this happens during indexing, we set a property on the message: index.repaired=skip-protected-headers-legacy-display Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-09-01cli/{show,reply}: skip over legacy-display partsDaniel Kahn Gillmor
Make use of the previous changes to fast-forward past any legacy-display parts during "notmuch show" and "notmuch reply". Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-09-01util/repair: add _notmuch_repair_crypto_payload_skip_legacy_displayDaniel Kahn Gillmor
This is a utility function designed to make it easier to "fast-forward" past a legacy-display part associated with a cryptographic envelope, and show the user the intended message body. The bulk of the ugliness in here is in the test function _notmuch_crypto_payload_has_legacy_display, which tests all of the things we'd expect to be true in a a cryptographic payload that contains a legacy display part. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-09-01util/crypto: _n_m_crypto_potential_payload returns whether part is the payloadDaniel Kahn Gillmor
Our _notmuch_message_crypto_potential_payload implementation could only return a failure if bad arguments were passed to it. It is an internal function, so if that happens it's an entirely internal bug for notmuch. It will be more useful for this function to return whether or not the part is in fact a cryptographic payload, so we dispense with the status return. If some future change suggests adding a status return back, there are only a handful of call sites, and no pressure to retain a stable API, so it could be changed easily. But for now, go with the simpler function. We will use this return value in future patches, to make different decisions based on whether a part is the cryptographic payload or not. But for now, we just leave the places where it gets invoked marked with (void) to show that the result is ignored. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-09-01util/crypto: _n_m_crypto_potential_payload: rename "payload" arg to "part"Daniel Kahn Gillmor
_notmuch_message_crypto_potential_payload is called on a GMimeObject while walking the MIME tree of a message to determine whether that object is the payload. It doesn't make sense to name the argument "payload" if it might not be the payload, so we rename it to "part" for clarity. This is a non-functional change, just semantic cleanup. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-09-01test: avoid showing legacy-display partsDaniel Kahn Gillmor
Enigmail generates a "legacy-display" part when it sends encrypted mail with a protected Subject: header. This part is intended to display the Subject for mail user agents that are capable of decryption, but do not know how to deal with embedded protected headers. This part is the first child of a two-part multipart/mixed cryptographic payload within a cryptographic envelope that includes encryption (that is, it is not just a cleartext signed message). It uses Content-Type: text/rfc822-headers. That is: A └┬╴multipart/encrypted B ├─╴application/pgp-encrypted C └┬╴application/octet-stream * ╤ <decryption> D └┬╴multipart/mixed; protected-headers=v1 (cryptographic payload) E ├─╴text/rfc822-headers; protected-headers=v1 (legacy-display part) F └─╴… (actual message body) In discussions with jrollins, i've come to the conclusion that a legacy-display part should be stripped entirely from "notmuch show" and "notmuch reply" now that these tools can understand and interpret protected headers. You can tell when a message part is a protected header part this way: * is the payload (D) multipart/mixed with exactly two children? * is its first child (E) Content-Type: text/rfc822-headers? * does the first child (E) have the property protected-headers=v1? * do all the headers in the body of the first child (E) match the protected headers in the payload part (D) itself? If this is the case, and we already know how to deal with the protected header, then there is no reason to try to render the legacy-display part itself for the user. Furthermore, when indexing, if we are indexing properly, we should avoid indexing the text in E as part of the message body. 'notmuch reply' is an interesting case: the standard use of 'notmuch reply' will end up omitting all mention of protected Subject:. The right fix is for the replying MUA to be able to protect its headers, and for it to set them appropriately based on headers found in the original message. If a replying MUA is unable to protect headers, but still wants the user to be able to see the original header, a replying MUA that notices that the original message's subject differs from the proposed reply subject may choose to include the original's subject in the quoted/attributed text. (this would be a stopgap measure; it's not even clear that there is user demand for it) This test suite change indicates what we want to happen for this case (the tests are currently broken), and includes three additional TODO suggestions of subtle cases for anyone who wants to flesh out the test suite even further. (i believe all these cases should be already fixed by the rest of this series, but haven't had time to write the tests for the unusual cases) Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-09-01repair: set up codebase for repair functionalityDaniel Kahn Gillmor
This adds no functionality directly, but is a useful starting point for adding new repair functionality. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-09-01mime-node: split out _mime_node_set_up_partDaniel Kahn Gillmor
This is a code reorganization that should have no functional effect, but will make future changes simpler, because a future commit will reuse the _mime_node_set_up_part functionality without touching _mime_node_create. In the course of splitting out this function, I noticed a comment in the codebase that referred to an older name of _mime_node_create (message_part_create), where this functionality originally resided. I've fixed that comment to refer to the new function instead. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-08-29configure: fix out of tree build; check unsafe characters in srcdirTomi Ollila
While check for GMime session key extraction support... was made out of tree build compatible, related (and some unrelated) unsafe characters are now checked in notmuch source directory path. The known unsafe characters in NOTMUCH_SRCDIR are: - Single quote (') -- NOTMUCH_SRCDIR='${NOTMUCH_SRCDIR}' is written to sh.config in configure line 1328. - Double quote (") -- configure line 521 *now* writes "$srcdir" into generated c source file ($NOTMUCH_SRCDIR includes $srcdir). - Backslash (\) could also be problematic in configure line 521. - The added $ and ` are potentially unsafe -- inside double quotes in shell script those have special meaning. Other characters don't expand inside double quoted strings.
2019-07-23notmuch-dump.c: Fix output file being closed twiceRalph Seichter
Fixed: If the output file for a dump was non-writeable, gzclose_w() was called twice on the output file handle, resulting in SIGABRT.
2019-07-21Merge branch 'release'David Bremner
Debian upload 0.29.1-2
2019-07-21Merge branch 'debian/unstable' into releaseDavid Bremner
2019-07-21debian: Changelog for re-upload to unstabledebian/0.29.1-2archive/debian/0.29.1-2David Bremner
2019-07-05test: aggregate-results.sh: count test files where all tests skippedTomi Ollila
Previously, when all tests were skipped on a test file, there were no indication of this in the final results aggregate-results.sh printed. Now count of the files where all tests were skipped is printed.
2019-07-05notmuch-show: run uncrustifyDaniel Kahn Gillmor
This is the result of running: $ uncrustify --replace --config devel/uncrustify.cfg *.c *.h In the top level source directory. I was using uncrustify 0.68.1+dfsg1-2. I do not know why these changes were not caught in 33382c2b5ba2537952a60ea378feff36961e4713 Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-06-29test: run uncrustifyDaniel Kahn Gillmor
This is the result of running: $ uncrustify --replace --config ../devel/uncrustify.cfg *.cc *.c *.h in the test directory. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-06-29test: replace use of gdb with LD_PRELOAD shims in T070-insert.shDavid Bremner
This removes the dependency of this test script on gdb, and considerably speeds up the running of the tests. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-06-29test: provide machinery to make and use test_shimsDavid Bremner
These can be used e.g. to override return values for functions, in place of the existing scripting of gdb. This prepends to LD_PRELOAD rather than clobbering it, thanks to a suggestion from Tomi Ollila. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-06-29emacs: add keywords to notmuch-emacs-mua.desktopDaniel Kahn Gillmor
Debian's lintian has an informational alert desktop-entry-lacks-keywords-entry, which recommends including Keywords= in a .desktop file. I dug around a bit in /usr/share/applications/*.desktop to make sure that we covered the range of keywords other e-mail applications are using. If anyone has other suggestions for keywords, they can add them to this list. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-06-17Merge branch 'release'David Bremner
2019-06-17configure: fix mktemp call for macOSRalph Seichter
Add missing template to mktemp, as required by macOS / OS X. Signed-off-by: Ralph Seichter <abbot@monksofcool.net>
2019-06-14lib: run uncrustifyuncrustify
This is the result of running $ uncrustify --replace --config ../devel/uncrustify.cfg *.c *.h *.cc in the lib directory
2019-06-14parse-time-string: run uncrustifyuncrustify
This is the result of running $ uncrustify --replace --config ../devel/uncrustify.cfg *.c *.h in the parse-time-string directory
2019-06-14compat: run uncrustifyuncrustify
This is the result of running $ uncrustify --replace --config ../devel/uncrustify.cfg *.c *.h in the compat directory
2019-06-14util: run uncrustifyuncrustify
This is the result of running $ uncrustify --replace --config ../devel/uncrustify.cfg *.c *.h in the util directory