From: markus schnalke Date: Mon, 17 Apr 2017 21:52:26 +0000 (+0200) Subject: mhpgp: use trusted header field copies to replace original header fields X-Git-Tag: mmh-0.4~39 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=403e71903f2bb190f83a2cababef05697babec5b;p=mmh mhpgp: use trusted header field copies to replace original header fields Enigmail provides so called ``protected-headers'', which are copies of some main mail header fields to protect them from forgery. Mhpgp(1) works in a rough way and simply adds this MIME part to the main header, and this resulted in a doubling of those header fields. Now those original headers are removed if trusted copies are provided within the encrpyted MIME part. --- diff --git a/uip/mhpgp.sh b/uip/mhpgp.sh index ce4d2c8..1cfa274 100755 --- a/uip/mhpgp.sh +++ b/uip/mhpgp.sh @@ -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