aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2011-06-03emacs: Cleaner interface when prompting for sender addressThomas Jost
Most of the time, every entry in the list of identities has the same user name part. It can then be filled in automatically, and the user can only be prompted for the email address, which makes the interface much cleaner.
2011-06-03emacs: Don't always prompt for the "From" address when replyingThomas Jost
When replying, the From: address is already filled in by notmuch reply, so most of the time there is no need to prompt the user for it.
2011-06-03emacs: fix notmuch-show-part-button to not include newlineJameson Graef Rollins
This makes the button cleaner, so that it doesn't include the entire rest of the line that the button is on.
2011-06-03Fix misspelling in search output sanitization test.Austin Clements
A simple spelling fix in the text description. Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
2011-06-03avoid segfault when calling sanitize_string() on NULLDaniel Kahn Gillmor
Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
2011-06-03lib/message-file: plug three memleaks.Anton Khirnov
Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
2011-06-03Use message-field-value instead of message-fetch-field in FCC header setup.Dmitry Kurochkin
For message-fetch-field the buffer is expected to be narrowed to just the header of the message. That is not the case when notmuch-fcc-header-setup is run, hence a wrong header value may be returned. E.g. when forwarding an email, (message-fetch-field "From") returns the From header value of the forwarded email. Message-field-value is the same as message-fetch-field, only narrows the buffer to the headers first. Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
2011-06-02bindings/python: Bump bindings version to 0.6Sebastian Spaeth
To match the upcoming release, and with the updated API to match the current libnotmuch, bump the python version number (notmuch.__VERSION__) to 0.6. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2011-06-02bindings/python: Implement Tags().__nonzero__()Sebastian Spaeth
Analog to Threads.__nonzero__ this allows us to perform list() on a Threads() object and to repeatedly call "if Tags():" or "bool(Tags())" without implicitly invoking len(), thus exhausting our iterator. While touching this code, I added a small micro-optimization to the Tag next() function. There is no need to explicitly check _is_valid, as _get implicitly does check for validness and returns None, if there is no more Tag to fetch. This avoids some roundtrips into the library when iterating through Tags. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2011-06-02bindings/python: implement Threads().__nonzero__Sebastian Spaeth
__nonzero__ checks if Threads() contains at least one more valid thread The existence of this function makes 'if Threads(): foo' work, as that previously implicitely called len() exhausting the iterator. This function makes `bool(Threads())` work repeatedly. For further info, see http://docs.python.org/reference/datamodel.html. Credits for the hint go to Brian May. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2011-06-02bindings/python: Include the new get_filenames in the API docsSebastian Spaeth
They had accidentally been left out, so we should also include the function docs for get_messages in the API docs. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2011-06-02bindings/python: Implement Message().get_filenames()Sebastian Spaeth
Message().get_filenames() will return a generator that allows to iterator over the recorded filenames for a certain Message. Do ntoe that as all generators, these are one-time use only. You will have to reget them to perform various actions. So this works:: len(Message().get_filenames()) list(Message().get_filenames()) for n in Message().get_filenames(): print n But this won't:: names = Message().get_filenames() len(names) #uses up the iterator list(names) #outch, already used up... Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2011-06-01emacs: Use "message-cited-text" instead of "message-cited-text-face"Pieter Praet
(describe-face 'message-cited-text-face) > message-cited-text-face is an alias for the face `message-cited-text'. > This face is obsolete since 22.1; use `message-cited-text' instead. Signed-off-by: Pieter Praet <pieter@praet.org> Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
2011-06-01test: cleanup search-output test names (no functional change)Jameson Graef Rollins
Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
2011-06-01test: add test for sanitized notmuch-search outputFlorian Friesdorf
This feature was recently added, so it of course needs a test now. Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net> Edited-by: Carl Worth <cworth@cworth.org> Fixed test to use notmuch_search_sanitize in order to be robust against unpredictable thread ID numbers, (due to unpredictable order in which the filesystem presents files).
2011-06-01Sanitize "Subject:" and "Author:" fields to not contain control characters in notmuch-searchAndreas Amann
When a Subject field contained encoded CRLF sequences, these sequences would appear unfiltered in the output of notmuch search. This confused the notmuch emacs interface leading to "Unexpected Output" messages. This is now fixed by replacing all characters with ASCII code less than 32 with a question mark. Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
2011-06-01emacs: Define several faces for the crypto-status buttonThomas Jost
Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net> jrollins modified this patch to conform to recent changes in the crypto processing since this patch was originally sent in.
2011-06-01test: Create and set temporary home directoryFlorian Friesdorf
In the master branch in test/emacs two tests access the build users home directory, so does emacs_deliver_message in the crypto branch. The tests should not touch the build user's home directory. The patch creates a directory in the temporary test directory and sets home accordingly. In case of a non-existent home directory, the tests are failing without this patch. Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
2011-06-01test: remove json test for search null result, since it's being more properly tested in search-outputJameson Graef Rollins
The test in json was inferior to the one in search-output, since it wasn't properly testing for the presence of a trailing newline.
2011-06-01test: move utf-8 subject search test from json to search test scriptJameson Graef Rollins
This test doesn't have anything to do with json, and has everything to do with testing search capability, so I'm not sure why it was in the wrong place.
2011-06-01test: Move a test from search to search-output, and add a similar json testJameson Graef Rollins
The "Search for non-existent message prints nothing" test fits better with the existing tests in search-output, so move it there. Also add a similar test for the --format=json case. These tests also use the new test_expect_equal_file function, (to ensure that the presence of a trailing newline is correctly tested).
2011-06-01Fix missing final newline in notmuch search outputJameson Graef Rollins
A previous commit to fix json formatting for null results (0b1ddc5f6652bde99d63d9d553777b3d926694cf) accidentally introduced a regression that removed trailing newlines for non-json output. (There wasn't a good test for this previously, but there is now). The problem is due to the fundamental differences in formatting between the json and non-json outputs. The only way to fix this was to add a new formatting field that represents the string to output at the end of a null result. All output formatting tests should pass now, (in particular, the 4 recent test failures introduced to show this bug).
2011-06-01test: modify search-output test to use the new test_expect_equal_file functionJameson Graef Rollins
These test now properly test for the presence of a newline at the end of all output. Right now some of these test will fail because the search output is currently broken to *not* produce proper newlines in some cases.
2011-06-01add note about updating the debian symbols file to the RELEASE fileJameson Graef Rollins
2011-06-01configure: Fix detection of libdir in ldconfig configurationCarl Worth
Ever since commit b4b5e9ce4dac62111ec11da6d22b7e618056801f the detection of libdir in the ldconfig configuration has been broken, resulting in RPATH being set when not needed and not wanted. The cause was a change from an IFS setting of: IFS="$(printf '\n\t')" to a new setting of: IFS="$(printf '\n')" That looks desirable since we want to split the output of ldconfig based on newlines, (and not split on any filename that might have an embedded tab in it). The subtle bug in the above is that the shell trims any trailing newlines when performing command substitution so the final statement above was equivalent to: IFS='' which prevented any splitting of the ldconfig output at all. Fix this by avoiding command substitution and just using a literal newline in the source file for setting this variable.
2011-05-31vim: add delete commandsFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-05-31vim: add support for delete in search viewFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-05-31vim: add support to mark as read in search viewFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-05-31vim: add support to mark as read in show viewFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-05-31Rename signerstatustostring to signer_status_to_stringCarl Worth
Otherwise, it's fartoohardformetoreadthis code.
2011-05-31Reduce some excessive indentation.Carl Worth
I prefer checking a condition and returning early rather than making large blocks of code within a function conditional.
2011-05-31show: Remove some dead code from show_text_part_contentCarl Worth
Now that this function registers an internal error if called with a non-text part, we can remove the conditions for multipart and message-part content types.
2011-05-31notmuch show: Don't do text conversions for non-text partsCarl Worth
This fixes the recently-added test case (in test/multipart) demonstrating corruption of binary parts that happen to contain CRLF pairs. We restore the original code from show_one_part_content to format_part_content_raw. Then, for good measure, we rename show_part_content to the more descriptive show_text_part_content and add an internal error if it is ever called with a non-text part.
2011-05-31test: Add test showing notmuch corrupts a part with a CRLF pair in itCarl Worth
Since commit 2f8871df6ea3c0b44f85a0fc1b4f58a6b70b0a0e notmuch has been using a function (show_part_content) originally written only for text parts to save all MIME parts. The problem with this is that this function converts CRLF pairs to LF only and optionally converts to UTF-8 encoding. These two conversions have the potential to corrupt binary data when passed through the function. This test demonstrates that corruption, and so fails currently, until we fix the bug.
2011-05-31test: Fix a misspelling in one of our test cases.Carl Worth
Not that it affects the correctness of the test, but it's nice to use proper spelling. This kind of change could invalidate a signature on the test message, but I think that would have happened previously when the HTML part was added in the first place.
2011-05-31test: add test for saving attachments using notmuch-show-save-partDmitry Kurochkin
Use .gz filenames for saved attachments in the tests to check that Emacs does not re-compress the file. Use test_expect_equal_file instead of test_expect_equal to avoid binary output on the console.
2011-05-31test: copy files in test_expect_equal_file instead of moving themDmitry Kurochkin
Before the change, test_expect_equal_file moved files it compared in case of failure. The patch changes it to copy the files instead. This allows testing non-temporary files which are stored in git. Note: the change should not result in new temporary files left after the tests. Test_expect_equal_file used to move files only on failure, so callers had to cleanup them anyway.
2011-05-31Don't re-compress .gz & al. in notmuch-show-save-part.Dmitry Kurochkin
Write-region handles some file names specially, see Emacs Lisp manual section 25.11 Making Certain File Names "Magic" [1]. This is a nice feature for normal text editing, but it is not desirable if we need to save raw file content (e.g. attachment). In particular, this affects archives and may result in corrupted attachments saved with notmuch-show-save-part (attachment button click handler). Turns out, smart GNUS folks encountered the same problem and implemented write-region wrapper which inhibits some file name handlers. In particular, this wrapper is used in mm-save-part, which is why notmuch-save-attachments that uses it works fine with archives. The patch replaces write-region with mm-write-region in notmuch-show-save-part. Also it removes coding-system-for-write and require-final-newline setting in notmuch-show-save-part. The former is set in mm-write-region. The latter seems to be unneeded because mm-save-part does not use it. [1] http://www.gnu.org/s/emacs/manual/html_node/elisp/Magic-File-Names.html
2011-05-27emacs: Give mutlipart/{signed, encrypted} their own part handler.Jameson Graef Rollins
This is the best way to make the displayed output for decrypted/verified messages clearer. The special sigstatus and encstatus buttons are now displayed under the part header button. The part header button is also tweaked to provide information to user about how to proces crypto.
2011-05-27emacs: Do not attempt to render arbitrary application parts.Jameson Graef Rollins
We probably shouldn't have been doing this anyway, but we do it here specifically because we don't want the content of the application/pgp-encrypted parts to be displayed and cluttering the message show.
2011-05-27Render all parts of multipart/encrypted when decrypting.Jameson Graef Rollins
The primary goal here is to keep the decrypted output as similarly structured as undecrypted output as possible. Now, when decrypting parts, only the original encrypted part is replaced by the it's decrypted content. If this part isn't itself a multipart, then all part numbering should remain consistent during decryption. The only draw back here is that the useless application/pgp-encrypted sub-part of the multipart/encrypted part is also emitted. But this part can be easily ignored by clients.
2011-05-27Do not replace multipart/signed part with content part when doing verification.Jameson Graef Rollins
Some folks have complained about the part renumbering that occurs when the entire multipart/signed part is replaced with the part contents after verification. This is primarily because it incurs an additional computational cost to retrieve individual parts, since verification has to be performed again to ensure that part numbering is consistent. This patch simply leaves the full multipart/signed part as is. The emacs crypto test is also updated to reflect this change.
2011-05-27tag signed/encrypted during notmuch newJameson Graef Rollins
This patch adds the tag "signed" to messages with any multipart/signed parts, and the tag "encrypted" to messages with any multipart/encrypted parts. This only occurs when messages are indexed during notmuch new, so a database rebuild is required to have old messages tagged.
2011-05-27emacs: Add support for PGP/MIME verification/decryptionJameson Graef Rollins
A new emacs configuration variable "notmuch-crypto-process-mime" controls the processing of PGP/MIME signatures and encrypted parts. When this is set true, notmuch-query will use the notmuch show --decrypt flag to decrypt encrypted messages and/or calculate the sigstatus of signed messages. If sigstatus is available, notmuch-show will place a specially color-coded header at the begining of the signed message. Also included is the ability to switch decryption/verification on/off on the fly, which is bound to M-RET in notmuch-search-mode.
2011-05-27Add decryption of PGP/MIME-encrypted parts with --decrypt.Jameson Graef Rollins
This adds support for decrypting PGP/MIME-encrypted parts to notmuch-show and notmuch-reply. The --decrypt option implies --verify. Once decryption (and possibly signature verification) is done, a new part_encstatus formatter is emitted, the part_sigstatus formatter is emitted, and the entire multipart/encrypted part is replaced by the contents of the encrypted part. At the moment only a json part_encstatus formatting function is available, even though decryption is done for all formats. Emacs support to follow.
2011-05-27Add signature verification of PGP/MIME-signed parts with --verify.Jameson Graef Rollins
This is primarily for notmuch-show, although the functionality is added to show-message. Once signatures are processed a new part_sigstatus formatter is emitted, and the entire multipart/signed part is replaced with the contents of the signed part. At the moment only a json part_sigstatus formatting function is available. Emacs support to follow. The original work for this patch was done by Daniel Kahn Gillmor <dkg@fifthhorseman.net> whose help with this functionality I greatly appreciate.
2011-05-27test: add crypto tests for signature verification and decryptionJameson Graef Rollins
This adds a new "crypto" test script to the test suite to test PGP/MIME signature verification and message decryption. Included here is a test GNUPGHOME with a test secret key (passwordless), and test for: * signing/verification * signing/verification with full owner trust * verification with signer key unavailable * encryption/decryption * decryption failure with missing key * encryption/decryption + signing/verfifying * reply to encrypted message * verification of signature from revoked key These tests are not expected to pass now, but will as crypto functionality is included.
2011-05-27test: add notmuch_show_sanitize_all function that is a little more aggressive.Jameson Graef Rollins
The old notmuch_show_sanitize function only scrubed part of the filename. This one scrubs the full filename, as well as the message id.
2011-05-27test: new test-lib function to test for equality between filesJameson Graef Rollins
We need to be able to test for the presence of a newline at the end of output. There's no good way to capture trailing newlines in bash, so redirecting output to a file is the next best thing. This new function should be used when testing for output that is expected to have trailing newlines. The next commit will demonstrate the use of this.
2011-05-27Break up format->part function into part_start and part_content functions.Jameson Graef Rollins
Future improvements (eg. crypto support) will require adding new part header. By breaking up the output of part headers from the output of part content, we can easily out new part headers with new formatting functions.