From: Johannes Weißl Date: Wed, 10 Nov 2010 12:12:17 +0000 (+0100) Subject: use formail if available (works for multiline Message-ID headers) X-Git-Url: https://projects.mako.cc/source/muttjump/commitdiff_plain/169f76f754e9e4632c165c4ef90c6d0b23bfe99d?hp=220e7295f53434bca273cb9a516da29bdb0dd5bb use formail if available (works for multiline Message-ID headers) --- diff --git a/muttjump b/muttjump index 0a45d1d..1f16321 100755 --- a/muttjump +++ b/muttjump @@ -46,6 +46,7 @@ MAIRIX=${MAIRIX:-mairix} MU=${MU:-mu} NMZMAIL=${NMZMAIL:-nmzmail} SCREEN=${SCREEN:-screen} +FORMAIL=${FORMAIL:-formail} function die () { echo -e >&2 "$0: $1" @@ -70,7 +71,11 @@ if ! type -p $MUTT >/dev/null ; then fi # search for Message-ID in STDIN -msgid=$(sed -n 's/^Message-ID: \(.*\)/\1/Ip' | head -n1) +if type -p $FORMAIL >/dev/null ; then + msgid=$(formail -c -z -x Message-ID | head -n1) +else + msgid=$(sed -n 's/^Message-ID: \(.*\)/\1/Ip' | head -n1) +fi if [ -z "$msgid" ] ; then die "could not find Message-ID header in standard input" fi