From: Johannes Weißl Date: Mon, 26 Apr 2010 22:17:05 +0000 (+0200) Subject: fix: case insensitive Message-ID grepping, maildir check X-Git-Url: https://projects.mako.cc/source/muttjump/commitdiff_plain/e0c62ec15db8b47d90597ef4ed894c468d923a26?ds=sidebyside fix: case insensitive Message-ID grepping, maildir check --- diff --git a/muttjump b/muttjump index aa9e8b8..8376fa0 100755 --- a/muttjump +++ b/muttjump @@ -50,7 +50,7 @@ if ! type -p $MUTT >/dev/null ; then fi # search for Message-ID in STDIN -msgid=$(sed -n 's/^Message-ID: \(.*\)/\1/p' | head -n1) +msgid=$(sed -n 's/^Message-ID: \(.*\)/\1/Ip' | head -n1) if [ -z "$msgid" ] ; then die "could not find Message-ID header in standard input" fi @@ -87,7 +87,11 @@ if [ -z "$orig_msgfile" -o ! -e "$orig_msgfile" ] ; then die "no message with msgid $msgid found!" fi +# get containing maildir of $orig_msgfile orig_maildir=$(dirname $(dirname "$orig_msgfile")) +if [ ! -d "$orig_maildir/cur" ] ; then + die "directory \"$orig_maildir\" doesn't exist or is no Maildir" +fi # Close message-stdin and open terminal-stdin instead. # mutt behaves different if STDIN is no terminal