+if type -p $FORMAIL >/dev/null ; then
+ msgid=$($FORMAIL -c -z -x Message-ID | head -n1)
+elif type -p $REFORMAIL >/dev/null ; then
+ msgid=$($REFORMAIL -c -x Message-ID: | head -n1)
+else
+ msgid=$(sed -n 's/^Message-ID: \(.*\)/\1/Ip' | head -n1)
+fi