--- /dev/null
+Return-Path: <nclapham@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id A8053431FD6\r
+ for <notmuch@notmuchmail.org>; Tue, 11 Jun 2013 14:34:41 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.699\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001,\r
+ RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id Zxp8VWcuZRGH for <notmuch@notmuchmail.org>;\r
+ Tue, 11 Jun 2013 14:34:34 -0700 (PDT)\r
+Received: from mail-pb0-f49.google.com (mail-pb0-f49.google.com\r
+ [209.85.160.49]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 10B8C431FC7\r
+ for <notmuch@notmuchmail.org>; Tue, 11 Jun 2013 14:34:33 -0700 (PDT)\r
+Received: by mail-pb0-f49.google.com with SMTP id jt11so8851033pbb.8\r
+ for <notmuch@notmuchmail.org>; Tue, 11 Jun 2013 14:34:33 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=sender:date:from:to:subject:message-id:mime-version:content-type\r
+ :content-disposition:user-agent;\r
+ bh=Or23COc4aSdxC5DiNBCxJ610sOkEOUF3JvVRFnrKWZU=;\r
+ b=LkypH50O9/vavtTkD2dIWVefKZMpCDyTeRupB88sPs3qd8KX7fxJKJdP7MTC1vv6It\r
+ Y5K7A8bZKTxBhSUuOBYQO+ohcPk9x6lmWQUD/KL/uzikc/Aaa724NPyC9Fr6PvlwUk/3\r
+ KPxK5c0+kSwcMOTmK3DXqhoosLr3sLcgNwAs3KA4CYSKURixmUSDf2e58a20bL4Allse\r
+ W7TFyaWOFD2znS1SQrvFH41okQPuK9ccvqh2WMwZlSFOL3s/XBwZEoTF0kI1DfObzXUP\r
+ bA2RbjqH704zyIYPqYRG2anT3LjK0vylJwCA3osXSBOUmlGMZRAxon4OZpyLfcjEiJvt\r
+ 3ZNQ==\r
+X-Received: by 10.66.27.196 with SMTP id v4mr20618320pag.97.1370986472183;\r
+ Tue, 11 Jun 2013 14:34:32 -0700 (PDT)\r
+Received: from Nathans-MacBook-Air.local (220-244-175-164.static.tpgi.com.au.\r
+ [220.244.175.164]) by mx.google.com with ESMTPSA id\r
+ vb8sm16175328pbc.11.2013.06.11.14.34.28 for <notmuch@notmuchmail.org>\r
+ (version=TLSv1 cipher=RC4-SHA bits=128/128);\r
+ Tue, 11 Jun 2013 14:34:30 -0700 (PDT)\r
+Sender: Nathan Clapham <nclapham@gmail.com>\r
+Received: by Nathans-MacBook-Air.local (Postfix, from userid 501)\r
+ id 54BD27CED96; Wed, 12 Jun 2013 07:34:24 +1000 (EST)\r
+Date: Wed, 12 Jun 2013 07:34:24 +1000\r
+From: Nathan Clapham <nathan@claphams.info>\r
+To: notmuch@notmuchmail.org\r
+Subject: Searching with prefix :folder and --output=files\r
+Message-ID: <20130611213424.GA5028@Nathans-MacBook-Air.local>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii; format=flowed\r
+Content-Disposition: inline\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Mailman-Approved-At: Tue, 11 Jun 2013 23:57:18 -0700\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 11 Jun 2013 21:34:41 -0000\r
+\r
+Hi Everyone, \r
+\r
+Thanks for notmuch mail, it is a great program!\r
+\r
+I am having an issue searching with --output=files and the folder prefix.\r
+\r
+Could you please tell me if I've misunderstood something or perhaps there is \r
+something wrong with my setup. Details of 2 examples below:\r
+\r
+$ notmuch --version\r
+notmuch 0.15.2\r
+\r
+----\r
+1. Archive folder\r
+\r
+Archive message #: 1356\r
+Directory: $HOME/Mail/Gmail/[Gmail].Archive\r
+\r
+$ notmuch count folder:Archive\r
+1356\r
+\r
+$ notmuch search --output=messages folder:Archive | wc -l\r
+1356\r
+\r
+$ notmuch search --output=files folder:Archive | wc -l\r
+1572\r
+\r
+I wondered why I was getting more files listed in the last example. It turns out \r
+some files are included from other folders. For example:\r
+\r
+Mail/Gmail/[Gmail].Sent Mail/cur/137075610...28e65ad90fc4f:2,S\r
+\r
+If I then do this:\r
+\r
+$ notmuch search --output=files folder:Archive | grep Archive | wc -l\r
+1356\r
+\r
+I get the correct count again.\r
+\r
+Different folders have a similar issue:\r
+\r
+2. INBOX folder\r
+\r
+INBOX message #: 87\r
+Directory: $HOME/Mail/Gmail/INBOX\r
+\r
+$ notmuch count folder:INBOX\r
+87\r
+\r
+$ notmuch search --output=messages folder:INBOX | wc -l\r
+87\r
+\r
+$ notmuch search --output=files folder:INBOX | wc -l\r
+97\r
+\r
+This time some messages from Archive are included:\r
+\r
+Mail/Gmail/[Gmail].Archive/cur/137077654...d7c877e152f72dd5ddbc11f:2,S\r
+\r
+$ notmuch search --output=files folder:INBOX | grep INBOX | wc -l\r
+87\r
+----\r
+\r
+I think this illustrates the problem I'm having. Maybe I don't understand how \r
+the folder: prefix works? Perhaps it is my folder structure - the inclusion of \r
+the imap prefix [Gmail].?? It seems the search is matching the correct messages \r
+though, but the output of files includes messages from another folder. \r
+\r
+Any advice would be appreciated.\r
+\r
+Thanks,\r
+Nathan.\r
+\r