From 6cea1344cb3bdfa2352a7893817be257ce166104 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sun, 22 Nov 2020 10:54:12 +0100 Subject: initial Commit --- generate-header | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 generate-header diff --git a/generate-header b/generate-header new file mode 100755 index 0000000..2828c7a --- /dev/null +++ b/generate-header @@ -0,0 +1,19 @@ +#!/bin/bash + +# TODO: extract uid from 'From: ' header +uid='eeerich@eckner.net' +key=$( + gpg \ + --export \ + --export-options=export-minimal \ + --export-filter "keep-uid='uid =~ ${uid}'" \ + "${uid}" \ + | base64 -w72 +) + +if [ -n "${key}" ]; then + printf 'Autocrypt: addr=%s; prefer-encrypt=mutual; keydata=\n' \ + "${uid}" + printf '%s\n' "${key}" \ + | sed 's/^/ /' +fi -- cgit v1.2.3-70-g09d2