--- /dev/null
+Return-Path: <sojkam1@fel.cvut.cz>\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 11659431FC2\r
+ for <notmuch@notmuchmail.org>; Mon, 26 May 2014 07:06:18 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_MED=-2.3] 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 9pbL4f9fGTvR for <notmuch@notmuchmail.org>;\r
+ Mon, 26 May 2014 07:06:10 -0700 (PDT)\r
+Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
+ by olra.theworths.org (Postfix) with ESMTP id 8D7B9431FBD\r
+ for <notmuch@notmuchmail.org>; Mon, 26 May 2014 07:06:10 -0700 (PDT)\r
+Received: from localhost (unknown [192.168.200.7])\r
+ by max.feld.cvut.cz (Postfix) with ESMTP id 6EB8F19F362F\r
+ for <notmuch@notmuchmail.org>; Mon, 26 May 2014 16:06:06 +0200 (CEST)\r
+X-Virus-Scanned: IMAP STYX AMAVIS\r
+Received: from max.feld.cvut.cz ([192.168.200.1])\r
+ by localhost (styx.feld.cvut.cz [192.168.200.7]) (amavisd-new,\r
+ port 10044) with ESMTP id fs5nM68-toSY for <notmuch@notmuchmail.org>;\r
+ Mon, 26 May 2014 16:06:01 +0200 (CEST)\r
+Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
+ by max.feld.cvut.cz (Postfix) with ESMTP id F097F19F3636\r
+ for <notmuch@notmuchmail.org>; Mon, 26 May 2014 16:06:01 +0200 (CEST)\r
+Received: from wsh by steelpick.2x.cz with local (Exim 4.82)\r
+ (envelope-from <sojkam1@fel.cvut.cz>)\r
+ id 1WovXM-0008S5-0O; Mon, 26 May 2014 16:06:00 +0200\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 0/2] Improve message threading\r
+Date: Mon, 26 May 2014 16:05:55 +0200\r
+Message-Id: <1401113157-32454-1-git-send-email-sojkam1@fel.cvut.cz>\r
+X-Mailer: git-send-email 2.0.0.rc2\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: Mon, 26 May 2014 14:06:18 -0000\r
+\r
+Hi all,\r
+\r
+I noticed that in certain situations notmuch does not reconstruct\r
+thread structure correctly. The fix was quite trivial - see the\r
+patches.\r
+\r
+The patch fixes my problem, however, as I learnt from the thread\r
+around id:87oazwjq1e.fsf@yoom.home.cworth.org, there are more problems\r
+in this code. I think that my problem is orthogonal to what was\r
+discussed there.\r
+\r
+The patch does not break any existing text (except two in\r
+T460-emacs-tree.sh, which fail even with 0.18 on my system).\r
+\r
+Cheers,\r
+-Michal\r
+\r
+Michal Sojka (2):\r
+ Add test for incorrect threading of messages\r
+ Make parsing of References and In-Reply-To header less error prone\r
+\r
+ lib/database.cc | 15 ++++++---------\r
+ test/T510-thread-replies.sh | 27 +++++++++++++++++++++++++++\r
+ 2 files changed, 33 insertions(+), 9 deletions(-)\r
+\r
+-- \r
+2.0.0.rc2\r
+\r