diff options
author | Leah Neukirchen <leah@vuxu.org> | 2019-01-10 16:53:47 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2019-01-10 16:53:47 +0100 |
commit | e9fb9ca79661a62f35b5371347220f0fe022aab9 (patch) | |
tree | e03a4978ea61e8d1ef775019645f99bf9b99778e /contrib | |
parent | 75980790a6c28e794237d7ba89771f8a67170bea (diff) | |
download | mblaze-e9fb9ca79661a62f35b5371347220f0fe022aab9.tar.gz mblaze-e9fb9ca79661a62f35b5371347220f0fe022aab9.tar.xz mblaze-e9fb9ca79661a62f35b5371347220f0fe022aab9.zip |
contrib/mencrypt: use default key for From:
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/mencrypt | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/mencrypt b/contrib/mencrypt index 12ef28c..438ca19 100755 --- a/contrib/mencrypt +++ b/contrib/mencrypt @@ -5,14 +5,17 @@ IFS=' ' -FLAGS=$(mhdr -d -A -h from:to:cc:bcc: "$1" |sort -u |sed 's/^/--recipient=/') +FLAGS=$(maddr -a -h from:to:cc:bcc: "$1" |sort -u |sed 's/^/--recipient=/') + +FROM=$(maddr -a -h from "$1" | sed 1q) +[ "$FROM" ] && key="--default-key=$FROM" TMPD=$(mktemp -d -t mencrypt.XXXXXX) trap "rm -rf '$TMPD'" INT TERM EXIT awk '/^$/,0' "$1" | mmime | - gpg --armor --encrypt --sign $FLAGS -o $TMPD/msg.asc || + gpg2 $key --armor --encrypt --sign $FLAGS -o $TMPD/msg.asc || exit $? printf 'Version: 1\n' >$TMPD/version |