Commit graph

2965 commits

Author SHA1 Message Date
Dmitry Kurochkin
6511b08fb8 test: remove "Generate some messages" test from raw
Before the change, the first subtest in raw format tests just
generated messages and checked that they are added successfully.  This
is not really a raw format test, it is creating of environment
required for other subtests to run.  The patch removes the first
subtest from raw and replaces it with bare add_message calls, similar
to how it is done in other tests.

TODO: we should check that test environment was created successfully.
Currently, many tests do add_message(), notmuch new and other calls
without checking the results.  We should come up with a general
solution for this, i.e. if any command during test initialization
fails, all tests should be skipped with appropriate error message.
2012-03-18 09:14:22 -03:00
Austin Clements
2f25295630 man: Update raw format documentation 2012-03-18 09:14:22 -03:00
Austin Clements
b1130bc71c show: Convert raw format to the new self-recursive style, properly support interior parts
This is fully compatible for root and leaf parts, but now has proper
support for interior parts.  This requires some design decisions that
were guided by what I would want if I were to save a part.
Specifically:

- Leaf parts are printed without headers and with transfer decoding.
  This is what makes sense for saving attachments.  (Furthermore, the
  transfer decoding is necessary since, without the headers, the
  caller would not be able to interpret non-transfer-decoded output.)

- Message parts are printed with their message headers, but without
  enclosing part headers.  This is what makes sense for saving a
  message as a whole (which is a message part) and for saving attached
  messages.  This is symmetric for whole messages and for attached
  messages, though we special-case the whole message for performance
  reasons (and corner-case correctness reasons: given malformed input,
  GMime may not be able to reproduce it from the parsed
  representation).

- Multipart parts are printed with their headers and all child parts.
  It's not clear what the best thing to do for multipart is, but this
  was the most natural to implement and can be justified because such
  parts can't be interpreted without their headers.

As an added benefit, we can move the special-case code for part 0 into
the raw formatter.
2012-03-18 09:14:22 -03:00
Austin Clements
7e1742a82c show: Move format_part_content_raw with the other new-style formats
Just code motion.
2012-03-18 09:14:21 -03:00
Austin Clements
d431239353 show: Convert mbox format to new self-recursive style
Given the lack of recursion, this is pretty easy.
2012-03-18 09:14:21 -03:00
Austin Clements
8d01b0749c show: Move format_message_mbox with the other new-style formats
Just code motion.
2012-03-18 09:14:21 -03:00
Austin Clements
6a4df1b796 show: Allow formatters to return errors
Formatter errors are propagated to the exit status of notmuch show.

This isn't used by the JSON or text formatters, but it will be useful
for the raw format, which is pickier.
2012-03-18 09:14:21 -03:00
Austin Clements
046ab77b10 test: Fix malformed multipart message
Previously, there was only one CRLF between the terminating boundary
of the embedded multipart/alternative and the boundary of the
containing multipart.  However, according the RFC 1341, 7.2.1:

  The boundary must be followed immediately either by another CRLF and
  the header fields for the next part, or by two CRLFs, in which case
  there are no header fields for the next part

and

  The CRLF preceding the encapsulation line is considered part of the
  boundary so that it is possible to have a part that does not end
  with a CRLF (line break).

Thus, there must be *two* CRLFs between these boundaries: one that
ends the terminating boundary and one that begins the enclosing
boundary.

While GMime accepted the message we had before, it could not produce
such a message.
2012-03-18 09:14:21 -03:00
Austin Clements
d2e96a35a5 test: Fix typo in test description
Part 4 is a multipart, not an html part.
2012-03-18 09:14:21 -03:00
David Bremner
fc4e5248d2 notmuch 0.12~rc2 release
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iJwEAAECAAYFAk9lxXUACgkQTiiN/0Um85nz8gP+PdsYdn6jyizOc1LYrWqeccQK
 La9HA5f+pdimEVTE1vRPwJT1Vz0saphiqCzRxNaYTtrFKQZ8Cz3z0pPs6/1mDAhD
 myGd9r5y566TNIxG2OlJHxxnmhoml1LNMLOHpj7ZMnNhrojKa0HmibtXlMR5ZN27
 tFP+UZn0c6Ad0JomezE=
 =IEn+
 -----END PGP SIGNATURE-----

Merge tag '0.12_rc2'

notmuch 0.12~rc2 release
2012-03-18 08:36:33 -03:00
David Bremner
9325cae5f4 debian: changelog stanza for 0.12~rc2
mention the two bugfixes
2012-03-18 08:16:55 -03:00
David Bremner
d71cb5e45b bump version to 0.12~rc2 2012-03-18 08:07:00 -03:00
Justus Winter
3a95f3fbc1 python: fix signature of two wrapped libnotmuch functions
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-03-18 07:59:36 -03:00
Justus Winter
ea54c4fdc7 Fix error reporting in notmuch_database_find_message_by_filename
Formerly it was possible for *message_ret to be left
uninitialized. The documentation however clearly states that "[o]n any
failure or when the message is not found, this function initializes
'*message' to NULL".

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-03-18 07:58:35 -03:00
David Bremner
4d17a34286 Merge branch 'release' 2012-03-14 23:01:38 -03:00
Jani Nikula
622d2f6128 NEWS: emacs: enable `notmuch-search-line-faces' by default 2012-03-14 23:01:29 -03:00
David Bremner
8c175aa120 Merge branch 'release' 2012-03-14 22:58:20 -03:00
Jani Nikula
d8b131c37d NEWS: cli: manual page for notmuch configuration options 2012-03-14 22:57:14 -03:00
Jani Nikula
743d3bcdd8 NEWS: emacs: inline patch fake attachment file names 2012-03-14 22:54:51 -03:00
Jani Nikula
8d479ce3e8 NEWS: emacs: support text/calendar MIME type 2012-03-14 22:54:21 -03:00
Jani Nikula
f9fd98142b NEWS: emacs: show view archiving key binding changes 2012-03-14 22:53:45 -03:00
Jani Nikula
bd99627e6d NEWS: emacs: Fix MML tag quoting in replies 2012-03-14 22:53:19 -03:00
David Bremner
0c20878cce Merge branch 'release' 2012-03-13 22:09:56 -03:00
David Bremner
eae27dd5cc debian: bump gmime dependency to 2.6.7
As explained in f34613e, if using gmime 2.6, we want at least 2.6.7
2012-03-13 21:40:40 -03:00
Jani Nikula
d379e3a0e2 man: update SEE ALSO references in man pages
Drop references to notmuch-part(1). Reference all man pages. Fix man
page section of notmuch-dump(1).
2012-03-13 21:34:44 -03:00
Thomas Jost
f34613ea83 build: Require gmime >= 2.6.7
gmime-2.6 had a bug [1] which made it impossible to tell why a signature
verification failed when the signer key was unavailable (empty "sigstatus" field
in the JSON output). Since 00b5623d the corresponding test is marked as broken
when using gmime-2.6 (2.4 is fine).

This bug has been fixed in gmime 2.6.5, which is now the minimal gmime-2.6
version required for building notmuch (gmime-2.4 is still available). As a
consequence the version check in test/crypto can be removed.

[Added by db]

Although less unambigously a bug, Gmime 2.6 prior to 2.6.7 also was
more strict about parsing, and rejected messages with initial "From "
headers.  This restriction is relaxed in [2].  For reasons explained in [3],
we want to keep this more relaxed parsing for now.

[1] https://bugzilla.gnome.org/show_bug.cgi?id=668085

[2] http://git.gnome.org/browse/gmime/commit/?id=d311f576baf750476e06e9a1367a2dc1793ea7eb

[3] id:"1331385931-1610-1-git-send-email-david@tethera.net"
2012-03-11 22:13:48 -03:00
David Bremner
c46764030d Merge branch 'release' 2012-03-10 21:46:26 -04:00
Jameson Graef Rollins
4d136995ce Fix configure script to properly detect gmime-2.6 if available.
Previously, the configure script would appear to detect gmime-2.6 if
present.  However, the binaries would end up being compiled against
gmime-2.4.  The addition of a break fixes things so that now gmime-2.6
will be used if available, falling back to gmime-2.4.
2012-03-10 21:39:13 -04:00
Austin Clements
353577ad57 Handle errors in mime_node_open 2012-03-10 21:25:19 -04:00
Jani Nikula
90f310b4fb emacs: fix MML quoting in replies
The reply MML quoting added in commit ae438cc unintentionally MML
quotes also the signature/encryption MML tags added via
message-setup-hook, causing the reply not to be signed/encrypted.

MML quote just the original message in the temp buffer before
inserting it to the message buffer, to not interfere with message mode
hooks or message construction in general.

See [1] and [2] for bug reports.

Thanks to Tim Bielawa <tbielawa@redhat.com> for testing.

[1] id:"87hay78x6l.fsf@wyzanski.jamesvasile.com"
[2] id:"1330812262-28272-1-git-send-email-tbielawa@redhat.com".

Signed-off-by: Jani Nikula <jani@nikula.org>
2012-03-10 21:24:14 -04:00
Michal Sojka
4a0740920d emacs-hello: Do not calculate the count of the messages in hidden sections
The result is that hello screen shows much faster when some sections are
hidden.
2012-03-10 10:10:27 -04:00
David Bremner
4b3af0e444 Make exclusion visible again
This reverts

dfee0f9 man: remove search.exclude_tags from notmuch-config.1 for 0.12
e83409d NEWS: revert NEWS item for exclude tags for 0.12
e77b031 config: disable addition of exclude tags for 0.12
2012-03-03 11:56:47 -04:00
David Bremner
ad6a6edb38 Merge branch 'release' 2012-03-03 11:56:36 -04:00
Justus Winter
cfc5f1059a Actually close the xapian database in notmuch_database_close
Formerly the xapian database object was deleted and closed in its
destructor once the object was garbage collected. Explicitly call
close() so that the database and the associated lock is released
immediately.

The comment is a courtesy of Austin Clements.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
2012-03-03 11:30:07 -04:00
David Bremner
3ed8c3d9a6 debian: Bump standards version
No actual changes are needed.
2012-03-03 09:40:18 -04:00
David Bremner
2a1aeb2e9c debian: update .gitignore
Ignore individual binary package directories.
2012-03-03 09:38:45 -04:00
David Bremner
8077cdc7bb debian: add notmuch_query_add_tag_exclude to exported symbols
This symbol is added in 0.12, although we are "stealthing" the feature
overall.
2012-03-03 09:19:44 -04:00
Mark Walters
dfee0f97b9 man: remove search.exclude_tags from notmuch-config.1 for 0.12 2012-03-03 08:33:26 -04:00
Mark Walters
e83409d21c NEWS: revert NEWS item for exclude tags for 0.12 2012-03-02 19:12:36 -04:00
Mark Walters
e77b031a86 config: disable addition of exclude tags for 0.12
This disables the addition of search_exclude_tags in notmuch-setup and
notmuch-config.
2012-03-02 19:11:35 -04:00
Mark Walters
1aa4abe7a1 emacs: notmuch.el ignore excluded matches
This is a small change to make notmuch.el ignore excluded matches.  In
the future it could do something better like add a button for
rerunning the search with the excludes (particularly if nothing
matches with the excludes) or having them invisible and allowing the
visibility to be toggled.
2012-03-02 08:38:27 -04:00
Mark Walters
119a42571e emacs: show: recognize the exclude flag.
Show mode will recognize the exclude flag by not opening excluding
messages by default, and will start at the first matching non-excluded
message. If there are no matching non-excluded messages it will go to
the first matching (necessarily excluded) message.
2012-03-02 08:37:50 -04:00
Mark Walters
7a1beb9e7c cli: omit excluded messages in results where appropriate.
In all cases of notmuch count/search/show where the results returned
cannot reflect the exclude flag return just the matched not-excluded
results. If the caller wishes to have all the matched results (i.e.,
including the excluded ones) they should call with the
--no-exclude option.

The relevant cases are
    count: both threads and messages
    search: all cases except the summary view
    show: mbox format
2012-03-02 08:37:32 -04:00
Mark Walters
99c318cae4 man: update manpage for notmuch-show --no-exclude option 2012-03-02 08:35:39 -04:00
Mark Walters
c8cf9e92d8 test: update tests to reflect the exclude flag
notmuch show outputs the exclude flag so many tests using notmuch
show failed. This commit adds "excluded:0" or "excluded: false" to
the expected outputs. After this commit there should be no failing
tests.
2012-03-02 08:35:02 -04:00
Mark Walters
ebe5e6712a cli: Make notmuch-show respect excludes.
This adds the excludes to notmuch-show.c. We do not exclude when only
a single message (or part) is requested. notmuch-show will output the
exclude information when either text or json format is requested. As
this changes the output from notmuch-show it breaks many tests (in a
trivial and expected fashion).
2012-03-02 08:34:36 -04:00
Mark Walters
c440e597f9 test: update search test to reflect exclude flag
notmuch-search.c now returns all matching threads even if it the
match is a search.tag_excluded message (but with a mark indicating
this). Update the test to reflect this.
2012-03-02 08:31:42 -04:00
Mark Walters
1a53f9f116 lib: Add the exclude flag to notmuch_query_search_threads
Add the NOTMUCH_MESSAGE_FLAG_EXCLUDED flag to
notmuch_query_search_threads. Implemented by inspecting the tags
directly in _notmuch_thread_create/_thread_add_message rather than as
a Xapian query for speed reasons.

Note notmuch_thread_get_matched_messages now returns the number of
non-excluded matching messages. This API is not totally desirable but
fixing it means breaking binary compatibility so we delay that.
2012-03-02 08:28:39 -04:00
Mark Walters
c9eb94d7fb lib: Make notmuch_query_search_messages set the exclude flag
Add a flag NOTMUCH_MESSAGE_FLAG_EXCLUDED which is set by
notmuch_query_search_messages for excluded messages. Also add an
option omit_excluded_messages to the search that we do not want the
excludes at all.

This exclude flag will be added to notmuch_query_search threads in the
next patch.
2012-03-02 08:27:47 -04:00
Mark Walters
08f7b026a9 lib: Rearrange the exclude code in query.cc
Slightly refactor the exclude code to give the callers access to the
exclude query itself. There should be no functional change.
2012-03-02 08:27:36 -04:00