aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAge
* Use stock GMimeSession by defaultGravatar Daniel Kahn Gillmor2011-06-03
| | | | | | | | | | | | Our use of GMimeSession was unneeded boilerplate, and we weren't doing anything with it. This simplifies and clarifies that assumption. If we want to do anything fancier later, the examples in the gmime source are a reasonable source to work from in defining a new GMimeSession derivative. Since GMimeSession is going away in GMime 2.6, though, i don't recommend using it.
* show: Avoid inadvertently closing stdoutGravatar Jameson Graef Rollins2011-06-03
| | | | | | | | | | | | | | | | | | | | | | | GMime has a nasty habit of taking ownership by default of any FILE* handed to it va g_mime_stream_file_new. Specifically it will close the FILE* when the stream is destroyed---even though GMime didn't open the file itself. To avoid this bad behavior, we have to carefully set_owner(FALSE) after calling g_mime_stream_file_new. In the format_part_content_text function, since commit d92146d3a6809f8ad940302af49cd99a0820665e we've been calling g_mime_stream_file_new unconditionally, but only calling g_mime_stream_file_set_owner(FALSE) conditionally. This led to the FILE* being closed early when notmuch show output was redirected to a file. Fixing this fixes the test-suite cases that broke with the previous commit, (which added redirected "notmuch show" calls to the test suite to expose this bug). Edited-by: Carl Worth <cworth@cworth.org> with a new commit message to explain the bug and fix.
* test: modify multipart test to use test_expect_equal_fileGravatar Jameson Graef Rollins2011-06-03
| | | | | | Again, this is a much cleaner and more thorough test, and in fact exposes a bug in the format=text output, that will be fixed the next commit. Because of this, some of the multipart tests currently fail.
* test: update emacs test to use test_expect_equal_fileGravatar Jameson Graef Rollins2011-06-03
| | | | | | | | | | This is a much cleaner way to do the emacs tests, since we're actually comparing output against existing files with expected output. We also won't miss any trailing newlines this way. And speaking of which, one of the expected output files was actually missing a trailing blank line that was actually in one of the original messages, so this was fixed.
* Make `notmuch-show-clean-address' parsing-error-proof.Gravatar Dmitry Kurochkin2011-06-03
| | | | | | | | Mail-header-parse-address may fail for an invalid address. Before the change, this would result in empty notmuch-show buffer with an error message like: Scan error: "Unbalanced parentheses". The patch wraps the function in condition-case and returns unchanged address in case of error.
* test: add "notmuch-show for message with invalid From" testGravatar Dmitry Kurochkin2011-06-03
|
* emacs: Cleaner interface when prompting for sender addressGravatar Thomas Jost2011-06-03
| | | | | | 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.
* emacs: Don't always prompt for the "From" address when replyingGravatar Thomas Jost2011-06-03
| | | | | 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.
* emacs: fix notmuch-show-part-button to not include newlineGravatar Jameson Graef Rollins2011-06-03
| | | | | This makes the button cleaner, so that it doesn't include the entire rest of the line that the button is on.
* Fix misspelling in search output sanitization test.Gravatar Austin Clements2011-06-03
| | | | | | A simple spelling fix in the text description. Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
* avoid segfault when calling sanitize_string() on NULLGravatar Daniel Kahn Gillmor2011-06-03
| | | | Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
* lib/message-file: plug three memleaks.Gravatar Anton Khirnov2011-06-03
| | | | Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
* Use message-field-value instead of message-fetch-field in FCC header setup.Gravatar Dmitry Kurochkin2011-06-03
| | | | | | | | | | | | | | 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>
* bindings/python: Bump bindings version to 0.6Gravatar Sebastian Spaeth2011-06-02
| | | | | | | | 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>
* bindings/python: Implement Tags().__nonzero__()Gravatar Sebastian Spaeth2011-06-02
| | | | | | | | 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>
* bindings/python: implement Threads().__nonzero__Gravatar Sebastian Spaeth2011-06-02
| | | | | | | | | | | | | __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>
* bindings/python: Include the new get_filenames in the API docsGravatar Sebastian Spaeth2011-06-02
| | | | | | | 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>
* bindings/python: Implement Message().get_filenames()Gravatar Sebastian Spaeth2011-06-02
| | | | | | | | | | | | | | | | | | | | 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>
* emacs: Use "message-cited-text" instead of "message-cited-text-face"Gravatar Pieter Praet2011-06-01
| | | | | | | | | (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>
* test: cleanup search-output test names (no functional change)Gravatar Jameson Graef Rollins2011-06-01
| | | | Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
* test: add test for sanitized notmuch-search outputGravatar Florian Friesdorf2011-06-01
| | | | | | | | | | | 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).
* Sanitize "Subject:" and "Author:" fields to not contain control characters ↵Gravatar Andreas Amann2011-06-01
| | | | | | | | | | | | in notmuch-search 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>
* emacs: Define several faces for the crypto-status buttonGravatar Thomas Jost2011-06-01
| | | | | | | 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.
* test: Create and set temporary home directoryGravatar Florian Friesdorf2011-06-01
| | | | | | | | | | | | | | 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>
* test: remove json test for search null result, since it's being more ↵Gravatar Jameson Graef Rollins2011-06-01
| | | | | | | properly tested in search-output 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.
* test: move utf-8 subject search test from json to search test scriptGravatar Jameson Graef Rollins2011-06-01
| | | | | | 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.
* test: Move a test from search to search-output, and add a similar json testGravatar Jameson Graef Rollins2011-06-01
| | | | | | | | | 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).
* Fix missing final newline in notmuch search outputGravatar Jameson Graef Rollins2011-06-01
| | | | | | | | | | | | | | 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).
* test: modify search-output test to use the new test_expect_equal_file functionGravatar Jameson Graef Rollins2011-06-01
| | | | | | | 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.
* add note about updating the debian symbols file to the RELEASE fileGravatar Jameson Graef Rollins2011-06-01
|
* configure: Fix detection of libdir in ldconfig configurationGravatar Carl Worth2011-06-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* vim: add delete commandsGravatar Felipe Contreras2011-05-31
| | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
* vim: add support for delete in search viewGravatar Felipe Contreras2011-05-31
| | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
* vim: add support to mark as read in search viewGravatar Felipe Contreras2011-05-31
| | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
* vim: add support to mark as read in show viewGravatar Felipe Contreras2011-05-31
| | | | Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
* Rename signerstatustostring to signer_status_to_stringGravatar Carl Worth2011-05-31
| | | | Otherwise, it's fartoohardformetoreadthis code.
* Reduce some excessive indentation.Gravatar Carl Worth2011-05-31
| | | | | I prefer checking a condition and returning early rather than making large blocks of code within a function conditional.
* show: Remove some dead code from show_text_part_contentGravatar Carl Worth2011-05-31
| | | | | | 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.
* notmuch show: Don't do text conversions for non-text partsGravatar Carl Worth2011-05-31
| | | | | | | | | | | 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.
* test: Add test showing notmuch corrupts a part with a CRLF pair in itGravatar Carl Worth2011-05-31
| | | | | | | | | | | | 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.
* test: Fix a misspelling in one of our test cases.Gravatar Carl Worth2011-05-31
| | | | | | | 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.
* test: add test for saving attachments using notmuch-show-save-partGravatar Dmitry Kurochkin2011-05-31
| | | | | | | | 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.
* test: copy files in test_expect_equal_file instead of moving themGravatar Dmitry Kurochkin2011-05-31
| | | | | | | | | | | 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.
* Don't re-compress .gz & al. in notmuch-show-save-part.Gravatar Dmitry Kurochkin2011-05-31
| | | | | | | | | | | | | | | | | | | | | | | | 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
* emacs: Give mutlipart/{signed, encrypted} their own part handler.Gravatar Jameson Graef Rollins2011-05-27
| | | | | | | | 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.
* emacs: Do not attempt to render arbitrary application parts.Gravatar Jameson Graef Rollins2011-05-27
| | | | | | | 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.
* Render all parts of multipart/encrypted when decrypting.Gravatar Jameson Graef Rollins2011-05-27
| | | | | | | | | | | | 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.
* Do not replace multipart/signed part with content part when doing verification.Gravatar Jameson Graef Rollins2011-05-27
| | | | | | | | | | | 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.
* tag signed/encrypted during notmuch newGravatar Jameson Graef Rollins2011-05-27
| | | | | | | | 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.
* emacs: Add support for PGP/MIME verification/decryptionGravatar Jameson Graef Rollins2011-05-27
| | | | | | | | | | | | | 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.