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 76f64f5c0748d46c6243fdf00f696395c9993f90
parent da38892d2abe5174b25e004af02699f7f0dd9aef
Author: Jaromil <jaromil@dyne.org>
Date:   Sun, 19 Mar 2017 23:50:08 +0100

various minor fixes

program name shown in logs, mutt invocation from main() and regex
match on isemail()

Diffstat:
Msrc/jaro | 14+++++---------
Msrc/zlibs/helpers | 2+-
2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/jaro b/src/jaro @@ -22,6 +22,7 @@ # this source code; if not, write to: # Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +PROGRAM=jaro-mail VERSION=4.3-dev DATE=Mar/2017 JAROMAILEXEC=$0 @@ -121,12 +122,7 @@ zmodload zsh/sched # SQL command SQL=sqlite3 - -PARAM=() -typeset -A global_opts -typeset -A opts - -vars+=(global_quit) +vars+=(PROGRAM global_quit) global_quit=0 # global variable for account selection @@ -867,9 +863,9 @@ EOF subcommand=${subcommand[(ws@:@)2]} func "subcommand: $subcommand" if isemail "$subcommand"; then - notice "Composing message to: ${@}" + notice "Composing message to: $*" # its an email, TODO see if we have it in our addressbook - x_mutt ${=@} + x_mutt $* exitcode=0 # or a directory of file elif maildircheck "$subcommand"; then @@ -881,7 +877,7 @@ EOF exitcode=$? elif [[ -f "$subcommand" ]]; then # is it a regular file? then ;attach it - x_mutt -a ${=@} + x_mutt -a $* exitcode=0 else # just open; mutt on first unread folder diff --git a/src/zlibs/helpers b/src/zlibs/helpers @@ -49,7 +49,7 @@ awk '{ for (i=1;i<=NF;i++) # zmodload zsh/regex isemail() { - [[ "$1" -regex-match "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" ]] && return 0 + [[ $1 -regex-match '\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b' ]] && return 0 return 1 }