--- /dev/null
+Return-Path: <m.walters@qmul.ac.uk>\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 954F2431FB6\r
+ for <notmuch@notmuchmail.org>; Sun, 18 Nov 2012 09:35:27 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.098\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
+ tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
+ NML_ADSP_CUSTOM_MED=1.2, 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 hvIetqDB8ARW for <notmuch@notmuchmail.org>;\r
+ Sun, 18 Nov 2012 09:35:27 -0800 (PST)\r
+Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
+ (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id D2FE5431FAF\r
+ for <notmuch@notmuchmail.org>; Sun, 18 Nov 2012 09:35:26 -0800 (PST)\r
+Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
+ by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1Ta8mD-0006KB-AK; Sun, 18 Nov 2012 17:35:25 +0000\r
+Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)\r
+ by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1Ta8mC-0003xt-WF; Sun, 18 Nov 2012 17:35:25 +0000\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: Peter Wang <novalazy@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 01/18] cli: add stub for insert command\r
+In-Reply-To: <1343223767-9812-1-git-send-email-novalazy@gmail.com>\r
+References: <1343223767-9812-1-git-send-email-novalazy@gmail.com>\r
+User-Agent: Notmuch/0.14+81~g9730584 (http://notmuchmail.org) Emacs/23.4.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Sun, 18 Nov 2012 17:35:23 +0000\r
+Message-ID: <87fw46q0f7.fsf@qmul.ac.uk>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: quoted-printable\r
+X-Sender-Host-Address: 93.97.24.31\r
+X-QM-SPAM-Info: Sender has good ham record. :)\r
+X-QM-Body-MD5: 7f9e8f0bcc1f536eb94a3f92e5bd6b5e (of first 20000 bytes)\r
+X-SpamAssassin-Score: -1.8\r
+X-SpamAssassin-SpamBar: -\r
+X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
+ determine if it is\r
+ spam. We require at least 5.0 points to mark a message as spam.\r
+ This message scored -1.8 points.\r
+ Summary of the scoring: \r
+ * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\r
+ * medium trust\r
+ * [138.37.6.40 listed in list.dnswl.org]\r
+ * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
+ provider * (markwalters1009[at]gmail.com)\r
+ * 0.5 AWL AWL: From: address is in the auto white-list\r
+X-QM-Scan-Virus: ClamAV says the message is clean\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: Sun, 18 Nov 2012 17:35:27 -0000\r
+\r
+\r
+Hi\r
+\r
+I have now been through essentially the whole series (except the tests)\r
+and broadly like it. Just to summarise my concerns from the individual\r
+replies here:\r
+\r
+What should insert do when interrupted and is it safe? I am not\r
+knowledgeable enough to be confident about that.\r
+\r
+I think some of the talloc allocations need their return values\r
+checked. I am more worried about this here then in most of the rest of\r
+notmuch as we are writing to the database (and even to the mailstore\r
+itself).\r
+\r
+My other concerns (code duplication with notmuch-tag.c and possible\r
+deadlock in the tmp file code and file overwriting) are easily fixable\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+\r
+\r
+\r
+On Wed, 25 Jul 2012, Peter Wang <novalazy@gmail.com> wrote:\r
+> This does nothing yet.\r
+> ---\r
+> Makefile.local | 1 +\r
+> notmuch-client.h | 3 +++\r
+> notmuch-insert.c | 27 +++++++++++++++++++++++++++\r
+> notmuch.c | 3 +++\r
+> 4 files changed, 34 insertions(+), 0 deletions(-)\r
+> create mode 100644 notmuch-insert.c\r
+>\r
+> diff --git a/Makefile.local b/Makefile.local\r
+> index 296995d..950f046 100644\r
+> --- a/Makefile.local\r
+> +++ b/Makefile.local\r
+> @@ -282,6 +282,7 @@ notmuch_client_srcs =3D \\r
+> notmuch-config.c \\r
+> notmuch-count.c \\r
+> notmuch-dump.c \\r
+> + notmuch-insert.c \\r
+> notmuch-new.c \\r
+> notmuch-reply.c \\r
+> notmuch-restore.c \\r
+> diff --git a/notmuch-client.h b/notmuch-client.h\r
+> index f930798..edbd3ee 100644\r
+> --- a/notmuch-client.h\r
+> +++ b/notmuch-client.h\r
+> @@ -132,6 +132,9 @@ int\r
+> notmuch_dump_command (void *ctx, int argc, char *argv[]);\r
+>=20=20\r
+> int\r
+> +notmuch_insert_command (void *ctx, int argc, char *argv[]);\r
+> +\r
+> +int\r
+> notmuch_new_command (void *ctx, int argc, char *argv[]);\r
+>=20=20\r
+> int\r
+> diff --git a/notmuch-insert.c b/notmuch-insert.c\r
+> new file mode 100644\r
+> index 0000000..0e061a0\r
+> --- /dev/null\r
+> +++ b/notmuch-insert.c\r
+> @@ -0,0 +1,27 @@\r
+> +/* notmuch - Not much of an email program, (just index and search)\r
+> + *\r
+> + * Copyright =C2=A9 2012 Peter Wang\r
+> + *\r
+> + * This program is free software: you can redistribute it and/or modify\r
+> + * it under the terms of the GNU General Public License as published by\r
+> + * the Free Software Foundation, either version 3 of the License, or\r
+> + * (at your option) any later version.\r
+> + *\r
+> + * This program is distributed in the hope that it will be useful,\r
+> + * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+> + * GNU General Public License for more details.\r
+> + *\r
+> + * You should have received a copy of the GNU General Public License\r
+> + * along with this program. If not, see http://www.gnu.org/licenses/ .\r
+> + *\r
+> + * Author: Peter Wang <novalazy@gmail.com>\r
+> + */\r
+> +\r
+> +#include "notmuch-client.h"\r
+> +\r
+> +int\r
+> +notmuch_insert_command (void *ctx, int argc, char *argv[])\r
+> +{\r
+> + return 1;\r
+> +}\r
+> diff --git a/notmuch.c b/notmuch.c\r
+> index 477a09c..86239fd 100644\r
+> --- a/notmuch.c\r
+> +++ b/notmuch.c\r
+> @@ -53,6 +53,9 @@ static command_t commands[] =3D {\r
+> { "new", notmuch_new_command,\r
+> "[options...]",\r
+> "Find and import new messages to the notmuch database." },\r
+> + { "insert", notmuch_insert_command,\r
+> + "[options...] [--] [+<tag>|-<tag> ...] < message",\r
+> + "Add a new message into the maildir and notmuch database." },\r
+> { "search", notmuch_search_command,\r
+> "[options...] <search-terms> [...]",\r
+> "Search for messages matching the given search terms." },\r
+> --=20\r
+> 1.7.4.4\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r