jaromail

a commandline tool to easily and privately handle your e-mail
git clone git://parazyd.org/jaromail.git
Log | Files | Refs | Submodules | README

commit 845c5680cba7983c7027b2bdc4cbbc4361fb62f6
parent 39ddbf528a112388f06596a534dedd4eea821286
Author: Jaromil <jaromil@dyne.org>
Date:   Fri, 17 Feb 2017 16:46:24 +0100

compose from commandline now takes first line as subject

Diffstat:
Msrc/zlibs/email | 16+++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/zlibs/email b/src/zlibs/email @@ -25,8 +25,8 @@ compose() { fn compose # among the args parse recipient emails and files to attach - _files=() - _addrs=() + local _files=() + local _addrs=() for p in ${PARAM}; do if [[ -r $p ]]; then func "attach: $p" @@ -39,7 +39,17 @@ compose() { fi done - cat | x_mutt ${=_files} -- ${=_addrs} + # take as subject the first line of body + ztmp + cat > $ztmpfile + local subject=`head -n1 $ztmpfile` + local nbsp=$'\255' + notice "Sending mail from commandline" + act "recipients: ${_addrs}" + [[ "$_files" = "" ]] || act "attachments: ${_files}" + act "subject: $subject" + cat <<EOF | x_mutt -s "${subject// /_}" -i $ztmpfile ${=_files} -- ${=_addrs} +EOF # _mutt -H <(print "To: ${PARAM[@]}") return $? }