[PATCH 1/4] test: add known broken test for empty from: and subject: query

2017-03-17 Thread David Bremner
These queries currently fail with field processors enabled because the code expects a non-empty string. --- test/T650-regexp-query.sh | 9 + 1 file changed, 9 insertions(+) diff --git a/test/T650-regexp-query.sh b/test/T650-regexp-query.sh index df48ab82..b1d84439 100755 ---

[PATCH 4/4] lib: only trigger phrase processing for regexp fields when needed

2017-03-17 Thread David Bremner
The argument is that if the string passed to the field processor has no spaces, then the added quotes won't have any benefit except for disabling wildcards. But disabling wildcards doesn't seem very useful in the normal Xapian query parser, since they're stripped before generating terms anyway. It

[PATCH 2/4] lib: handle empty string in regexp field processors

2017-03-17 Thread David Bremner
The non-field processor behaviour is is convert the corresponding queries into a search for the unprefixed terms. This yields pretty surprising results so decided to match any message. --- lib/regexp-fields.cc | 3 +++ test/T650-regexp-query.sh | 2 -- 2 files changed, 3 insertions(+), 2

fixes for regexp field processors

2017-03-17 Thread David Bremner
This series fixes two bugs introduces in notmuch 0.24 1) queries of the form 'from:foo*' and 'subject:bar*' no longer work (the * is just silently dropped) 2) queries of the form 'from:""' and 'subject:""' crashes with an uncaught exception. Unless there objections, I'll probably roll these

[PATCH 3/4] test: add known broken tests wildcard search in from and subject

2017-03-17 Thread David Bremner
This was broken by the addition of regexp searching. The detection of wildcards is not currently done in the recursive call to parse_query, because of quoting issues. --- test/T650-regexp-query.sh | 10 ++ 1 file changed, 10 insertions(+) diff --git a/test/T650-regexp-query.sh

[PATCH] lib/message.cc: fix Coverity finding (use after free)

2017-03-17 Thread Tomi Ollila
The object where pointer to `data` was received was deleted before it was used in _notmuch_string_list_append(). Relevant Coverity messages follow: 3: extract Assigning: data = std::__cxx11::string(message->doc.()).c_str(), which extracts wrapped state from temporary of type

Re: [PATCH] fix memory leaks in notmuch-show.c:format_headers_sprinter()

2017-03-17 Thread Tomi Ollila
On Thu, Mar 16 2017, Jeffrey Stedfast wrote: > Hey guys, > > Was just grepping through notmuch sources and discovered what I think are > memory leaks in notmuch-show.c’s format_headers_sprinter() code. > > Internet_address_list_to_string() and

Re: [PATCH] rename libutil.a to libnotmuch_util.a

2017-03-17 Thread Tomi Ollila
On Tue, Mar 14 2017, David Bremner wrote: > Apparently some systems (MacOS?) have a system library called libutil > and the name conflict causes problems. Since this library is quite > notmuch specific, rename it to something less generic. > --- LGTM > Makefile.global |

Re: [RFC patch 2/2] lib: index message files with duplicate message-ids

2017-03-17 Thread Daniel Kahn Gillmor
On Thu 2017-03-16 20:34:22 -0400, David Bremner wrote: > Daniel Kahn Gillmor writes: >> 0) what happens when one of the files gets deleted from the message >> store? do the terms it contributes get removed from the index? > > That's a good guestion, and an issue I

Announcing Astroid v0.8

2017-03-17 Thread Gaute Hope
Greetings, Astroid v0.8 is now ready! Astroid is a lightweight and fast graphical threads-with-tags email client for notmuch. Written in C++ using GTK+, WebKit and gmime. Astroid can be found at: $ git clone https://github.com/astroidmail/astroid.git ## Usage and instructions

Re: Inconsistency between tag database and notmuch search

2017-03-17 Thread David Bremner
Navin Kabra writes: > > Specifically, I have a few threads/messages that don't have any tags, > but still show up in notmuch search for those tags. And using notmuch > tag to remove (or add) any tags on these threads has no effect. Doing > a `notmuch compact` does not fix this

[PATCH] test: add known broken test for xapian wildcard search in from:

2017-03-17 Thread David Bremner
This was broken by the addition of regexp searching. The detection of wildcards is not currently done in the recursive call to parse_query, perhaps because of quoting issues. --- There should be a similar test for subject: but I wanted to report this bug now. test/T650-regexp-query.sh | 5 +

Inconsistency between tag database and notmuch search

2017-03-17 Thread Navin Kabra
I've managed to get my notmuch tag database in an inconsistent state and can't figure out how to fix it. Because of this I have "unread" messages sitting in my inbox permanently and I can't get rid of them. Specifically, I have a few threads/messages that don't have any tags, but still