From 877ae0f1628060031930a790988697e3ef410a2f Mon Sep 17 00:00:00 2001 From: Matthew Lear Date: Tue, 17 Feb 2015 22:04:17 +0000 Subject: [PATCH] Inspired but need help searching folder names containing spaces --- 17/223c67ec0b4a8ffb5c9d58e512101f0f544c70 | 119 ++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 17/223c67ec0b4a8ffb5c9d58e512101f0f544c70 diff --git a/17/223c67ec0b4a8ffb5c9d58e512101f0f544c70 b/17/223c67ec0b4a8ffb5c9d58e512101f0f544c70 new file mode 100644 index 000000000..acaaa923a --- /dev/null +++ b/17/223c67ec0b4a8ffb5c9d58e512101f0f544c70 @@ -0,0 +1,119 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id E528A429E30 + for ; Tue, 17 Feb 2015 14:25:27 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 2.438 +X-Spam-Level: ** +X-Spam-Status: No, score=2.438 tagged_above=-999 required=5 + tests=[DNS_FROM_AHBL_RHSBL=2.438] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 12DBvIfjimUM for ; + Tue, 17 Feb 2015 14:25:24 -0800 (PST) +X-Greylist: delayed 390 seconds by postgrey-1.32 at olra; + Tue, 17 Feb 2015 14:25:24 PST +Received: from sip.bubblegen.co.uk (bubblegen.plus.com [80.229.236.194]) + (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 944DD431E82 + for ; Tue, 17 Feb 2015 14:25:24 -0800 (PST) +Message-ID: <54E3BAE1.1030004@bubblegen.co.uk> +Date: Tue, 17 Feb 2015 22:04:17 +0000 +From: Matthew Lear +MIME-Version: 1.0 +To: notmuch@notmuchmail.org +Subject: Inspired but need help searching folder names containing spaces +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: 8bit +X-Mailman-Approved-At: Tue, 17 Feb 2015 22:52:21 -0800 +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Tue, 17 Feb 2015 22:25:28 -0000 + +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 -- 2.26.2