Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id AEBD7431FD0 for ; Sun, 6 Feb 2011 05:29:14 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Al-gaYzgo6xl for ; Sun, 6 Feb 2011 05:29:14 -0800 (PST) Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com [209.85.161.53]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 1F94E431FB6 for ; Sun, 6 Feb 2011 05:29:13 -0800 (PST) Received: by mail-fx0-f53.google.com with SMTP id 11so4326160fxm.26 for ; Sun, 06 Feb 2011 05:29:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=R9vqx0V4mYaWObfogZfksHIo+DorUXUTIYGWUW1p7ZA=; b=K/WaxyogYc+BCEqKQx6VfluiwRlP5xtg/6FgbJ3rWZiDhvCrt/abUERVpfc6zV95mC vog1gd4qg24WbsqkrzbjCLrRXQxqNKdHTyTBAPoyFYytHE1660PFKkGlptrP8iVkxGoQ Pw0w79eRy6gDV2cCvfLvPNBvAVAgGrAsvfGos= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=bU3u4R4AtfMoO/99C5O0XxLhSLXfUgFPsDk4luM4MZuAFx0K4aSMxyKrBganA9T7dD 1FXdBvUrFGvrOseT12ccKkedfmcOCM8D60tsgjGcs+BRtBR/7OZ81mruDynQ8DNlgraT kDxJpTzXr4guoaY5gTo/o3XFD2zIhkfFdLIFE= Received: by 10.223.96.67 with SMTP id g3mr8755806fan.19.1296998953731; Sun, 06 Feb 2011 05:29:13 -0800 (PST) Received: from localhost (a91-153-253-80.elisa-laajakaista.fi [91.153.253.80]) by mx.google.com with ESMTPS id a2sm842091faw.22.2011.02.06.05.29.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 06 Feb 2011 05:29:13 -0800 (PST) From: Felipe Contreras To: notmuch@notmuchmail.org Subject: [PATCH 1/2] vim: use sendmail directly Date: Sun, 6 Feb 2011 15:29:06 +0200 Message-Id: <1296998947-13683-2-git-send-email-felipe.contreras@gmail.com> X-Mailer: git-send-email 1.7.4.1.g4f7e4.dirty In-Reply-To: <1296998947-13683-1-git-send-email-felipe.contreras@gmail.com> References: <1296998947-13683-1-git-send-email-felipe.contreras@gmail.com> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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, 06 Feb 2011 13:29:14 -0000 The problem with 'mailx' is that it's not standardized, and it doesn't allow the -f option, which is pretty important on many sendmail configurations. Signed-off-by: Felipe Contreras --- vim/plugin/notmuch.vim | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/vim/plugin/notmuch.vim b/vim/plugin/notmuch.vim index 3375a96..002b771 100644 --- a/vim/plugin/notmuch.vim +++ b/vim/plugin/notmuch.vim @@ -24,6 +24,7 @@ let s:notmuch_defaults = { \ 'g:notmuch_cmd': 'notmuch' , + \ 'g:notmuch_sendmail': 'sendmail' , \ 'g:notmuch_debug': 0 , \ \ 'g:notmuch_search_newest_first': 1 , @@ -948,18 +949,19 @@ function! s:NM_compose_send() let line = getline(lnum) let lst_hdr = '' while match(line, '^$') == -1 - if match(line, '^Notmuch-Help:') == -1 + if !exists("hdr_starts") && match(line, '^Notmuch-Help:') == -1 let hdr_starts = lnum - 1 - break endif let lnum = lnum + 1 let line = getline(lnum) endwhile + let body_starts = lnum - 1 + call append(body_starts, 'Date: ' . strftime('%a, %d %b %Y %H:%M:%S %z')) exec printf(':0,%dd', hdr_starts) write - let cmdtxt = 'mailx -t < ' . fname + let cmdtxt = g:notmuch_sendmail . ' -t < ' . fname let out = system(cmdtxt) let err = v:shell_error if err -- 1.7.4.1.g4f7e4.dirty