From: Mark Walters Date: Wed, 12 Jun 2013 08:48:44 +0000 (+0100) Subject: Re: Searching with prefix :folder and --output=files X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fe0537d301267540a0c8343c0501a7fa99391a1e;p=notmuch-archives.git Re: Searching with prefix :folder and --output=files --- diff --git a/3f/b1302155a97b02a2b5327bdb5d4e965ce014b7 b/3f/b1302155a97b02a2b5327bdb5d4e965ce014b7 new file mode 100644 index 000000000..a1f983764 --- /dev/null +++ b/3f/b1302155a97b02a2b5327bdb5d4e965ce014b7 @@ -0,0 +1,166 @@ +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 1288A431FC7 + for ; Wed, 12 Jun 2013 01:49:04 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -1.098 +X-Spam-Level: +X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 oelC2iUGwudy for ; + Wed, 12 Jun 2013 01:48:56 -0700 (PDT) +Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id ECCC1431FBC + for ; Wed, 12 Jun 2013 01:48:55 -0700 (PDT) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1UmgjV-00082q-T6; Wed, 12 Jun 2013 09:48:48 +0100 +Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) + (envelope-from ) + id 1UmgjV-0000Oa-Ir; Wed, 12 Jun 2013 09:48:45 +0100 +From: Mark Walters +To: Nathan Clapham , notmuch@notmuchmail.org +Subject: Re: Searching with prefix :folder and --output=files +In-Reply-To: <20130611213424.GA5028@Nathans-MacBook-Air.local> +References: <20130611213424.GA5028@Nathans-MacBook-Air.local> +User-Agent: Notmuch/0.15.2+171~ge2f30a2 (http://notmuchmail.org) Emacs/23.4.1 + (i486-pc-linux-gnu) +Date: Wed, 12 Jun 2013 09:48:44 +0100 +Message-ID: <87k3lz90k3.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Sender-Host-Address: 93.97.24.31 +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: 323a1351dffaa825e915be9071b253b9 (of first 20000 bytes) +X-SpamAssassin-Score: -0.0 +X-SpamAssassin-SpamBar: / +X-SpamAssassin-Report: The QM spam filters have analysed this message to + determine if it is + spam. We require at least 5.0 points to mark a message as spam. + This message scored -0.0 points. + Summary of the scoring: + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * -0.0 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +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: Wed, 12 Jun 2013 08:49:04 -0000 + + +Hello + +This is the "expected" but, I agree, counter-intuitive result. + +First notmuch finds all the *messages* that match your query (ie +which have an associated filename matching the folder: part of your +query) and then it returns all filenames for these messages. + +I think that notmuch views a message (as determined by a message-id) as +a single object in its database (it assumes that all copies are +identical) so fixing this would not be easy. + +Best wishes + +Mark + + +Nathan Clapham writes: + +> Hi Everyone, +> +> Thanks for notmuch mail, it is a great program! +> +> I am having an issue searching with --output=files and the folder prefix. +> +> Could you please tell me if I've misunderstood something or perhaps there is +> something wrong with my setup. Details of 2 examples below: +> +> $ notmuch --version +> notmuch 0.15.2 +> +> ---- +> 1. Archive folder +> +> Archive message #: 1356 +> Directory: $HOME/Mail/Gmail/[Gmail].Archive +> +> $ notmuch count folder:Archive +> 1356 +> +> $ notmuch search --output=messages folder:Archive | wc -l +> 1356 +> +> $ notmuch search --output=files folder:Archive | wc -l +> 1572 +> +> I wondered why I was getting more files listed in the last example. It turns out +> some files are included from other folders. For example: +> +> Mail/Gmail/[Gmail].Sent Mail/cur/137075610...28e65ad90fc4f:2,S +> +> If I then do this: +> +> $ notmuch search --output=files folder:Archive | grep Archive | wc -l +> 1356 +> +> I get the correct count again. +> +> Different folders have a similar issue: +> +> 2. INBOX folder +> +> INBOX message #: 87 +> Directory: $HOME/Mail/Gmail/INBOX +> +> $ notmuch count folder:INBOX +> 87 +> +> $ notmuch search --output=messages folder:INBOX | wc -l +> 87 +> +> $ notmuch search --output=files folder:INBOX | wc -l +> 97 +> +> This time some messages from Archive are included: +> +> Mail/Gmail/[Gmail].Archive/cur/137077654...d7c877e152f72dd5ddbc11f:2,S +> +> $ notmuch search --output=files folder:INBOX | grep INBOX | wc -l +> 87 +> ---- +> +> I think this illustrates the problem I'm having. Maybe I don't understand how +> the folder: prefix works? Perhaps it is my folder structure - the inclusion of +> the imap prefix [Gmail].?? It seems the search is matching the correct messages +> though, but the output of files includes messages from another folder. +> +> Any advice would be appreciated. +> +> Thanks, +> Nathan. +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch