Inspired but need help searching folder names containing spaces

Matthew Lear matt at bubblegen.co.uk
Fri Feb 20 08:53:43 PST 2015


Hi David,

>> notmuch search 'folder:"Deleted Items"'
>>
>> .. throws up zero results.
>>
>
> Hmm. I tried to duplicate your situation here, and it works for me. Two
> things to try:
>
> 1) notmuch search --output=files $QUERY
>
> where $QUERY is some query (using e.g. id:) that matches one of those
> messages. Check that you have have the whole anchored path from the top
> level.
>
> 2) NOTMUCH_DEBUG_QUERY=1 notmuch count -'folder:"Deleted Items"'
>
> have a look for XFOLDER:Deleted Items
>
> 3) try both of the above with "--exclude=false" in case you have tagged
> them with an excluded tag.  Note that by default "deleted" is such a tag.
> You can change the excluded tags with "notmuch config"

As part of still playing around with notmuch and strategies for tagging
etc, I decided to start afresh with the database so I deleted it. After
running notmuch new, I could quite happily search with notmuch search
'folder:"Deleted Items"'. This surprised me greatly because I know that I
didn't apply any tags to mails in Deleted Items (couldn't find any in
there to tag) and I also already tried searching with --exclude=false. In
any case, it seems that searching in folders with spaces now works. Hurrah
:-)

A couple of others things have surprised me, though. Using the date search
option, such as date:"today" or date:"yesterday", hasn't quite thrown up
what I expected. Searching with date:"today" shows up no results (which I
know is wrong) and searching with date:"yesterday" shows up a handful of
emails all from the same person, in different threads which all arrived on
a day in May 2014... Got to be a bug there somewhere :-D

One last thing which I'd like to explore if I may is searching for emails
sent to me. By default, I think notmuch classes 'to me' as 'to or cc or
bcc me'. Is there a way to search/filter on emails sent only to me (ie
where my name / address is only in the to: field in the message header)?
This seems a reasonable requirement / use case so I'm assuming that
there's a good reason that notmuch views it differently.

An example is an automated bug tracking system which sends emails to the
current assignee of the bug (to) and also watchers (cc). I'd like to be
able to filter these emails differently (ie bugs I'm watching versus bugs
I'm responsible for fixing). Apart from using other fields in the message
body (which may be subject to change), there doesn't seem an easy way to
do this which is surprising given notmuch's flexibility and power.

Thoughts?

I'm still exploring strategies for tagging and searching etc. The links on
the wiki are helpful. The possibilities are almost infinite and while
everybody's mail is different, having a great deal of flexibility can
sometimes makes it tricky to decide on exactly what's best. Still, it's an
enjoyable task, despite being time consuming, and is well worth the
effort.

  Matt



More information about the notmuch mailing list