--- /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 DE1A34196F0\r
+ for <notmuch@notmuchmail.org>; Thu, 1 Apr 2010 07:21:17 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.001\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.001 tagged_above=-999 required=5\r
+ tests=[BAYES_20=-0.001] autolearn=ham\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 P+-NsDim6R0y for <notmuch@notmuchmail.org>;\r
+ Thu, 1 Apr 2010 07:21:16 -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 C1060431FC1\r
+ for <notmuch@notmuchmail.org>; Thu, 1 Apr 2010 07:21:16 -0700 (PDT)\r
+Received: from localhost (unknown [192.168.200.4])\r
+ by max.feld.cvut.cz (Postfix) with ESMTP id 3029319F3614;\r
+ Thu, 1 Apr 2010 16:21:16 +0200 (CEST)\r
+X-Virus-Scanned: IMAP AMAVIS\r
+Received: from max.feld.cvut.cz ([192.168.200.1])\r
+ by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new,\r
+ port 10044)\r
+ with ESMTP id 35eTLNqc6emK; Thu, 1 Apr 2010 16:21:15 +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 03CDA19F3361;\r
+ Thu, 1 Apr 2010 16:21:14 +0200 (CEST)\r
+Received: from steelpick.2x.cz (k335-30.felk.cvut.cz [147.32.86.30])\r
+ (Authenticated sender: sojkam1)\r
+ by imap.feld.cvut.cz (Postfix) with ESMTPSA id C311AFA003;\r
+ Thu, 1 Apr 2010 16:21:14 +0200 (CEST)\r
+Received: from wsh by steelpick.2x.cz with local (Exim 4.71)\r
+ (envelope-from <sojkam1@fel.cvut.cz>)\r
+ id 1NxLGk-0005hL-KI; Thu, 01 Apr 2010 16:21:14 +0200\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: nstraz@redhat.com, notmuch@notmuchmail.org\r
+In-Reply-To: <20100401134721.GD25669@redhat.com>\r
+References: <20100401134721.GD25669@redhat.com>\r
+Date: Thu, 01 Apr 2010 16:21:14 +0200\r
+Message-ID: <87wrwr45k5.fsf@steelpick.2x.cz>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Subject: Re: [notmuch] [PATCH] Setup the GMimeStream only when needed\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: Thu, 01 Apr 2010 14:21:18 -0000\r
+\r
+On Thu, 01 Apr 2010, nstraz@redhat.com wrote:\r
+> I ran into this while looking at the vim plugin. Vim's system() call\r
+> redirects output to a file and it was missing many of the part{ lines.\r
+> \r
+> If stream_stdout is setup too early, it will overwrite the part start\r
+> when notmuch is redirected to a file.\r
+\r
+Hi,\r
+\r
+thanks for the patch. After some investigation, it seems that you are\r
+right. What I missed in your commit message is the reason for such\r
+behaviour i.e. GMimeStream fseek()s in its write method to the position\r
+recorded when the stream was created, so that in case there is somebody\r
+else writing to the stream, the writes may overlap.\r
+\r
+-Michal\r