diff options
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/msign | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/msign b/contrib/msign index bfec07b..7f23ab4 100755 --- a/contrib/msign +++ b/contrib/msign @@ -9,8 +9,11 @@ IFS=' TMPD=$(mktemp -d -t msign.XXXXXX) trap "rm -rf '$TMPD'" INT TERM EXIT +FROM=$(maddr -a -h from "$1" | sed 1q) +[ "$FROM" ] && key="--default-key=$FROM" + awk '/^$/,0' "$1" | mmime | sed 's/$/ /' >"$TMPD"/content -gpg2 --armor --detach-sign -o "$TMPD"/signature.asc "$TMPD"/content || +gpg2 $key --armor --detach-sign -o "$TMPD"/signature.asc "$TMPD"/content || exit $? { |