--- /dev/null
+Return-Path: <alpine.art.de@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 0734C431FB6\r
+ for <notmuch@notmuchmail.org>; Tue, 14 Oct 2014 06:45:37 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_FROM=0.001, 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 TNUpxN4bk-lH for <notmuch@notmuchmail.org>;\r
+ Tue, 14 Oct 2014 06:45:29 -0700 (PDT)\r
+Received: from mail-la0-f47.google.com (mail-la0-f47.google.com\r
+ [209.85.215.47]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id C0D28431FAF\r
+ for <notmuch@notmuchmail.org>; Tue, 14 Oct 2014 06:45:28 -0700 (PDT)\r
+Received: by mail-la0-f47.google.com with SMTP id pv20so8400823lab.6\r
+ for <notmuch@notmuchmail.org>; Tue, 14 Oct 2014 06:45:25 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=date:message-id:from:to:cc:subject:in-reply-to:references\r
+ :mime-version:content-type:content-disposition\r
+ :content-transfer-encoding;\r
+ bh=0mcLQD1QmOUzFvBJblncjftIOqHLJSzMqM5qaSbLj9U=;\r
+ b=cSv3pKEKWrrDpuvr/jI8N3rQQTtHWliezFWGmA08dWMA4WwFcw94K3Kv5XDV4MN2th\r
+ WbhdVT/ON9HMj7WmtACa8+LWGMsS9fd9zGzqDBNuPg/3mZQ6YaiRCVSPUX0M5xNTyeDA\r
+ KBRs6xE3jcmaTNXAHvNfkMGna8S4IgA8MTfo+PEeRIJ3le53ffYCQBBz2JzIXnS+ZG57\r
+ ePmoyXFiW5dgi+3RHAC2PsZjMOP9EV3BQOoU/znMmJqj+vZQAtaO8MUz5lQncRXPJkBr\r
+ 0xmlV8B/qH/99jpnhkJX9x5btuscgrQOtY/KKDvVnO8oZhswqk0EG5lrZHoBz0YOU5Ar\r
+ LCmg==\r
+X-Received: by 10.112.133.138 with SMTP id pc10mr5538692lbb.48.1413294325664; \r
+ Tue, 14 Oct 2014 06:45:25 -0700 (PDT)\r
+Received: from localhost (p5B00C854.dip0.t-ipconnect.de. [91.0.200.84])\r
+ by mx.google.com with ESMTPSA id bk5sm5617818lbd.30.2014.10.14.06.45.23\r
+ for <multiple recipients>\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Tue, 14 Oct 2014 06:45:24 -0700 (PDT)\r
+Date: Tue, 14 Oct 2014 15:45:35 +0200\r
+Message-ID: <20141014154535.GJ23373@TP_L520.localdomain>\r
+From: Franz Fellner <alpine.art.de@gmail.com>\r
+To: Ian Main <imain@stemwinder.org>\r
+Subject: Re: [PATCH] VIM: Make an option to save sent mail locally\r
+In-Reply-To: <1412619036-29203-1-git-send-email-imain@stemwinder.org>\r
+References: <1412617904-27252-1-git-send-email-imain@stemwinder.org>\r
+ <1412619036-29203-1-git-send-email-imain@stemwinder.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Disposition: inline\r
+Content-Transfer-Encoding: 8bit\r
+Cc: notmuch@notmuchmail.org\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, 14 Oct 2014 13:45:37 -0000\r
+\r
+Why not simply use Notmuch::Database.add_message? Would save a\r
+system-call.\r
+One could easily copy the sent mail into nm_db_path/sent/cur, add it to the db, tag it.\r
+Though I don't know enough about maildir handling, but probably rubys\r
+Mail module could help here.\r
+\r
+Another issue is configuration. Hardcoding "Sent" probably won't fit\r
+everyones needs. And (if I understand DOCS correctly) db.add_message\r
+doesn't even force you to keep sent mail folder inside db_path; correct\r
+me if I'm wrong :) notmuch --insert will put it into folder relative to\r
+db_path.\r
+\r
+All in all the feature and the the rest of your work is very much\r
+appreciated!\r
+\r
+Franz\r
+\r
+On Mon, 6 Oct 2014 11:10:36 -0700, Ian Main <imain@stemwinder.org> wrote:\r
+> Add an option to use 'notmuch insert' to save your sent mail.\r
+> ---\r
+> \r
+> Add -inbox as well.\r
+> \r
+> vim/notmuch.vim | 17 +++++++++++++++++\r
+> 1 file changed, 17 insertions(+)\r
+> \r
+> diff --git a/vim/notmuch.vim b/vim/notmuch.vim\r
+> index 331e930..a9044c4 100644\r
+> --- a/vim/notmuch.vim\r
+> +++ b/vim/notmuch.vim\r
+> @@ -58,6 +58,7 @@ let s:notmuch_date_format_default = '%d.%m.%y'\r
+> let s:notmuch_datetime_format_default = '%d.%m.%y %H:%M:%S'\r
+> let s:notmuch_reader_default = 'mutt -f %s'\r
+> let s:notmuch_sendmail_default = 'sendmail'\r
+> +let s:notmuch_save_sent_locally_default = 1\r
+> let s:notmuch_folders_count_threads_default = 0\r
+> \r
+> function! s:new_file_buffer(type, fname)\r
+> @@ -108,6 +109,18 @@ EOF\r
+> echohl None\r
+> return\r
+> endif\r
+> +\r
+> + if g:notmuch_save_sent_locally\r
+> + let out = system('cat ' . fname . ' | notmuch insert --create-folder --folder=Sent +sent -unread -inbox')\r
+> + let err = v:shell_error\r
+> + if err\r
+> + echohl Error\r
+> + echo 'Eeek! unable to save sent mail'\r
+> + echo out\r
+> + echohl None\r
+> + return\r
+> + endif\r
+> + endif\r
+> call delete(fname)\r
+> echo 'Mail sent successfully.'\r
+> call s:kill_this_buffer()\r
+> @@ -388,6 +401,10 @@ endfunction\r
+> "" root\r
+> \r
+> function! s:set_defaults()\r
+> + if !exists('g:notmuch_save_sent_locally')\r
+> + let g:notmuch_save_sent_locally = s:notmuch_save_sent_locally_default\r
+> + endif\r
+> +\r
+> if !exists('g:notmuch_date_format')\r
+> if exists('g:notmuch_rb_date_format')\r
+> let g:notmuch_date_format = g:notmuch_rb_date_format\r
+> -- \r
+> 1.9.3\r
+> \r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r