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 ae369db8889baf1ab0c18566d200b847b9025d22
parent d021cdc5828a71e5cddd818cb86a2b3f3b5d4fba
Author: Jaromil <jaromil@dyne.org>
Date:   Tue, 28 Aug 2012 03:01:14 +0200

can add attachments when launching from commandline

Diffstat:
Msrc/zlibs/helpers | 26+++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/src/zlibs/helpers b/src/zlibs/helpers @@ -31,7 +31,7 @@ autostart() { { test ! -r $MUTTDIR/rc } \ && { error "Jaro Mail is not yet configured."; return 1 } - mutt -F $MUTTDIR/rc + mutt -F $MUTTDIR/rc ${=muttflags} return $? } @@ -41,21 +41,29 @@ autostart() { | grep '^[a-zA-Z0-9._%+-]*@[a-zA-Z0-9]*[\.[a-zA-Z0-9]*]*[a-zA-Z0-9]$' \ > /dev/null { test $? = 0 } && { - notice "Composing message to: ${1}" + notice "Composing message to: ${@}" # its an email, TODO see if we have it in our addressbook - mutt -F $MUTTDIR/rc "${1}" + mutt -F $MUTTDIR/rc ${=muttflags} ${=@} return 0 } - # or a path to folder - { test -r ${1} } && { - mutt -F $MUTTDIR/rc -f ${1} - return 0 + + # or a directory of file + { test -r "$1" } && { + # is it a maildir? then open + maildircheck ${1} + { test $? = 0 } && { + mutt -F $MUTTDIR/rc ${=muttflags} -f ${1} + return 0 } + # is it a regular file? then attach it + { test -f "$1" } && { + mutt -F $MUTTDIR/rc ${=muttflags} -a ${=@} + return 0 } } # or the name of a folder in Jaro Mail - { test -r $MAILDIRS/${1} } && { + { test -r "$MAILDIRS/$1" } && { notice "Opening folder ${1}" - mutt -F $MUTTDIR/rc -f "$MAILDIRS/${1}" + mutt -F $MUTTDIR/rc ${=muttflags} -f "$MAILDIRS/${1}" return 0 }