From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 66F7E6DE1006 for ; Sat, 12 Sep 2015 23:19:53 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.719 X-Spam-Level: X-Spam-Status: No, score=-0.719 tagged_above=-999 required=5 tests=[AWL=0.101, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id twZ9k2pGj9qN for ; Sat, 12 Sep 2015 23:19:50 -0700 (PDT) Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by arlo.cworth.org (Postfix) with ESMTPS id 428496DE0B27 for ; Sat, 12 Sep 2015 23:19:50 -0700 (PDT) Received: by wicfx3 with SMTP id fx3so104145306wic.1 for ; Sat, 12 Sep 2015 23:19:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=Botw2jsYgFMpclSJIBwvMl4QIVa25nxnFCsFOUCgPAM=; b=KRwRDrkTP31vBcePv5DBNkxsnXM4kNNnMzgrxOwHdoVvIuLE0G5AAsfT9dFsIg0hrg CPNpESViPldUqiK7scgjww1tC6KTD7YamerwBwQ/i1kaaGWQLsAZVP84J2AO6ITvD5Np /KfGdcmshI+0JlKQVP+7SUIezg04NMfDdfhbeD7Mc+ZyNnov9XNhhAwrpIVomSwnIFyZ ezer4zV4bB8K9BLVPeE8SMxz4coL1pA6UvYuDxnHvqbOp2xMEh3Utax+yZX4Y7VwE7XX pi8ouHnumecuoGZ5wPoT9atnSnzfZph5ax/zJevF1ypTecRyMmHYc3U90kP/dwwBm7Qc gpCA== X-Received: by 10.194.93.198 with SMTP id cw6mr15447260wjb.113.1442125187928; Sat, 12 Sep 2015 23:19:47 -0700 (PDT) Received: from chitra.no-ip.org (5072840E.static.ziggozakelijk.nl. [80.114.132.14]) by smtp.gmail.com with ESMTPSA id ex8sm7596489wib.14.2015.09.12.23.19.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Sep 2015 23:19:46 -0700 (PDT) Sender: Suvayu Ali Date: Sun, 13 Sep 2015 08:19:45 +0200 From: Suvayu Ali To: notmuch@notmuchmail.org Subject: Re: Possible some threads are not complete due to bug? Message-ID: <20150913061945.GD18353@chitra.no-ip.org> Mail-Followup-To: notmuch@notmuchmail.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1 (2014-03-12) X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.18 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: Sun, 13 Sep 2015 06:19:53 -0000 Hi, You should include a reference to the original message, not everyone will remember the thread. id:20150614082258.GD17381@chitra.no-ip.org or On Sun, Sep 13, 2015 at 12:03:20AM -0400, Xu Wang wrote: > > Sometimes I need to do: > > $ notmuch search --output=threads "id:MYMSGID" > thread:000000000000a125 > $ notmuch search --output=messages "thread:000000000000a125" Looking at the script again, I see I assumed a message will belong to a single thread. You can remove that assumption by applying the following change. -----8<--------------------8<----- diff -u nm-ack nm-ack --- nm-ack 2015-06-15 01:30:40.327556510 +0200 +++ nm-ack 2015-09-13 07:58:30.734096931 +0200 @@ -10,8 +10,9 @@ # debug # set -o xtrace -declare query="$1" thread=$(notmuch search --output=threads -- "$1") -declare -a msgs=$(notmuch search --output=messages -- "$thread") responses +declare query="$1" +declare -a thread=$(notmuch search --output=threads -- "$1") +declare -a msgs=$(notmuch search --output=messages -- "${thread[@]}") responses function strip_mid() { sed -e 's/ \+//g' -e 's/<\([^ <>]\+\)>/\1/g' ----->8-------------------->8----- > In theory, this should output the message that responded to message ID > "MYMSGID". Sometimes it works. But sometimes it does not work. That > is, there exists an email where I am sure (I checked the raw email) > that there is a header > In-Reply-To: > but that email does not show when I do the two commands above. > Indeed, that mail belongs to a different thread ID. > > I am just curious if the above is due to: > > 1. My missing of understanding of how notmuch deals with threads > 2. A bug or missing feature in notmuch causes some threads to be incomplete Interesting issue. I can think of a case, say a message is cross-posted to multiple lists, it might then give you more than one thread ids. Is this the case for your message? If you are up for it, look in lib/thread.cc. I think the relevant methods are: _resolve_thread_relationships and _notmuch_thread_create, but I could be wrong. I'm not familiar with the notmuch source. As I recall, you are using mutt-kz; does work from mutt-kz? I would expect that to fail too. It gets the thread id like this: id = notmuch_message_get_thread_id(msg); Hope this helps, -- Suvayu Open source is the future. It sets us free.