X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhpgp.sh;h=1cfa27451d5a486c785d232d494faf289ed82ade;hp=f3a39ea0bb6e9213eb32d0a9896efd4134e046e4;hb=93fa896ceb5fbebe2f1f6e6e36419a13f8ffd99f;hpb=2932d136debcf53a45c44891ee80e6d34e61f109 diff --git a/uip/mhpgp.sh b/uip/mhpgp.sh index f3a39ea..1cfa274 100755 --- a/uip/mhpgp.sh +++ b/uip/mhpgp.sh @@ -6,7 +6,7 @@ # mhpgp: # -write: Save the decrypted message to the current folder -usage="Usage: mhpgp [-write] msg" +usage="Usage: mhpgp [-write] [-Version] [-help] [+folder] [msg]" # prepend the default options from the profile set -- `mhparam -nocomp ${0##*/}` "$@" @@ -68,7 +68,7 @@ mimeverify() { ### decrypt MIME and non-MIME messages (type is in $1) ###; invoke the pager as needed decrypt() { - sed -n -e '\ + sed -n -e ' /^-----BEGIN PGP MESSAGE/b x d :x @@ -103,6 +103,14 @@ decrypt() { b a' "$FILE" > "$TEMP/outfile" if [ "$1" = "plain" ] ; then echo "" >> "$TEMP/outfile" ; fi + + # Replace original header fields by secure copies that some + # mail clients (e.g. Enigmail) store within the encrypted and + # signed MIME part. + for i in `sed -n '/^$/q; /^[ ]/d; s,:.*,,p' "$TEMP/msg"` ; do + anno -delete -comp "$i" "$TEMP/outfile" + done + sed -e 's/ $//' $TEMP/msg >> "$TEMP/outfile" || exit 1 if [ "$wflag" = "1" ] ; then