unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH 1/2] vim: use sendmail directly
Date: Sun,  6 Feb 2011 15:29:06 +0200	[thread overview]
Message-ID: <1296998947-13683-2-git-send-email-felipe.contreras@gmail.com> (raw)
In-Reply-To: <1296998947-13683-1-git-send-email-felipe.contreras@gmail.com>

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 <felipe.contreras@gmail.com>
---
 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

  reply	other threads:[~2011-02-06 13:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-06 13:29 [PATCH 0/2] vim: improvements for sendmail Felipe Contreras
2011-02-06 13:29 ` Felipe Contreras [this message]
2011-02-06 13:29 ` [PATCH 2/2] vim: parse 'from' address Felipe Contreras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1296998947-13683-2-git-send-email-felipe.contreras@gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).