mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 19:08:09 +01:00
vim: use sendmail directly
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>
This commit is contained in:
parent
5cdf424657
commit
e7899b00d0
1 changed files with 5 additions and 3 deletions
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
let s:notmuch_defaults = {
|
let s:notmuch_defaults = {
|
||||||
\ 'g:notmuch_cmd': 'notmuch' ,
|
\ 'g:notmuch_cmd': 'notmuch' ,
|
||||||
|
\ 'g:notmuch_sendmail': 'sendmail' ,
|
||||||
\ 'g:notmuch_debug': 0 ,
|
\ 'g:notmuch_debug': 0 ,
|
||||||
\
|
\
|
||||||
\ 'g:notmuch_search_newest_first': 1 ,
|
\ 'g:notmuch_search_newest_first': 1 ,
|
||||||
|
@ -949,18 +950,19 @@ function! s:NM_compose_send()
|
||||||
let line = getline(lnum)
|
let line = getline(lnum)
|
||||||
let lst_hdr = ''
|
let lst_hdr = ''
|
||||||
while match(line, '^$') == -1
|
while match(line, '^$') == -1
|
||||||
if match(line, '^Notmuch-Help:') == -1
|
if !exists("hdr_starts") && match(line, '^Notmuch-Help:') == -1
|
||||||
let hdr_starts = lnum - 1
|
let hdr_starts = lnum - 1
|
||||||
break
|
|
||||||
endif
|
endif
|
||||||
let lnum = lnum + 1
|
let lnum = lnum + 1
|
||||||
let line = getline(lnum)
|
let line = getline(lnum)
|
||||||
endwhile
|
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)
|
exec printf(':0,%dd', hdr_starts)
|
||||||
write
|
write
|
||||||
|
|
||||||
let cmdtxt = 'mailx -t < ' . fname
|
let cmdtxt = g:notmuch_sendmail . ' -t < ' . fname
|
||||||
let out = system(cmdtxt)
|
let out = system(cmdtxt)
|
||||||
let err = v:shell_error
|
let err = v:shell_error
|
||||||
if err
|
if err
|
||||||
|
|
Loading…
Reference in a new issue