Inspired but need help searching folder names containing spaces

Matthew Lear matt at bubblegen.co.uk
Tue Feb 17 14:04:17 PST 2015


Hello all,

As part of trying to cope with an extremely high amount of email at
work, after a couple years of using X1 Search on Windows in conjunction
with MS Outlook and many years getting incredibly frustrated at the lack
of, and then failures of, email search features built into linux desktop
environments such as KDE and Gnome, I craved a better tool for linux.
Recently, I stumbled on the combination of offlineimap and notmuch and
I'm convinced that this will make my world a better place. I'm still
finding my way in terms of optimum ways to tag and filter my email, but
this is a fun ongoing task that will continue over the coming weeks and
months and I'm seeing a light at the end of the tunnel. So firstly,
thank you.

So...One thing I'm struggling with is searching for emails in folders
which contain spaces in their name. The IMAP server at work is Exchange
based and I have Inbox, Deleted Items and Sent Items folders (among many
others) all at the same top level. I'm using the default offlineimap
configuration which uses '.' as the separator. After a sync I have...

mail/maildir/
├── INBOX
├── Deleted Items
...
└── Sent Items

....on the file system. These directories have the cur, new and tmp sub
directories associated with maildir. All ok so far.

I have several emails in Deleted Items and Sent Items. I can ls and cat
them just fine. What I cannot do, however, is search them with notmuch.
Reading the very helpful replies in this thread
(http://notmuchmail.org/pipermail/notmuch/2014/019053.html), I thought
I'd stumbled on a solution. However, searching with..

notmuch search 'folder:"Deleted Items"'

.. throws up zero results.

Confusingly, if I sync a different IMAP account with offlineimap and
index it with notmuch, I can successfully search folders which contain
spaces in their name, but in that account, these folders exist *under*
INBOX, eg

mail/maildir2/
├── INBOX
├── INBOX.Deleted Items
...
└── INBOX.Sent Items

So searching with..

notmuch search 'folder:"INBOX.Deleted Items"'

..works.

So why the difference? AFAICT the syntax I'm using is correct and should
allow the string to be searched in the Xapian database. I just don't
understand why one directory level seems to make a difference between a
successful and an unsuccessful search.

Any thoughts?

If it helps I'm running notmuch 0.19 and xapian 1.2.18 on Gentoo linux.

I suppose I don't need to sync Deleted Items, and I can tag -inbox
emails sent by me, but I'd still like to be able to search both these
folders if I need to.

Can anybody help suggest what could be going wrong?

Many thanks from a very happy new notmuch user.
--  Matt


More information about the notmuch mailing list