mcom: use mhdr -d -A even when extracting From: headers

We only want to decode the display part of the addresses only.

Mails with a From: like
  From: "Non-ASCII Lastname, Firstname" <mail@example.org>
resulted in To: lines like
  To: Non-ASCII Lastname, Firstname <mail@example.org>
which would send to two addresses.  Use -A to ensure proper decoding
and quoting, even if its just a single address in From.
pull/211/head
Leah Neukirchen 3 years ago
parent 4f1f0ea2b3
commit 5c7432aa7b

@ -312,7 +312,7 @@ fi
IFS=$NL
for f in $(mseq -r "$@"); do
printf '%s Forwarded message from %s %s\n\n' \
$SEP "$(mhdr -d -h from "$f")" $SEP
$SEP "$(mhdr -d -A -h from "$f")" $SEP
DISPLAY= mshow -n -N "$f" </dev/null |
sed 's/^-/- &/' # RFC 934
printf '\n%s %s %s\n\n' \
@ -355,7 +355,7 @@ fi
printf 'Newsgroups: %s\n' "$ng"
else
to=$(mhdr -d -h reply-to "$1")
[ -z "$to" ] && to=$(mhdr -d -h from "$1")
[ -z "$to" ] && to=$(mhdr -d -A -h from "$1")
printf 'To: %s\n' "$to"
printf 'Cc: %s\n' \
"$(mhdr -d -A -h to:cc: "$1" |

Loading…
Cancel
Save