From 9722d50b9b6c5ccd81892a00bdd3023399b004fb Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Wed, 5 Dec 2018 15:47:34 +0100 Subject: DKIM: also include the "d=" tag in key filenames, not only the "s=" tag. While the combination of "s=" tag (selector) & "d=" tag signing domain maps to a unique key, the selector alone doesn't necessarily. --- certs/dkim/README | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'certs/dkim/README') diff --git a/certs/dkim/README b/certs/dkim/README index e5addf9..2137a8d 100644 --- a/certs/dkim/README +++ b/certs/dkim/README @@ -1,10 +1,11 @@ -To convert a PEM-encoded public key to a TXT record, run +To convert the PEM-encoded public keys from this directory to TXT +records, run $ SELECTOR="8f00fb94ec6c37aacb48bd43e073f9b7" $ DOMAIN="fripost.org" - $ printf "%s._domainkey%s IN TXT (\n" "$SELECTOR" "${DOMAIN:+.$DOMAIN.}"; \ + $ printf "%s._domainkey.%s IN TXT (\n" "$SELECTOR" "$DOMAIN"; \ { printf "v=DKIM1; k=rsa; t=s; s=email; p="; - sed '/^--.*--$/d' <"./certs/dkim/$SELECTOR.pub" | tr -d '\n'; + openssl pkey -pubin -in "./certs/dkim/$SELECTOR:$DOMAIN.pub" -outform DER | base64 -w0 } | fold -w64 | sed 's/.*/ "&"/; $s/$/ )\n/' Remove the "t=s" tag if subdomaining or third-party signature (hosted -- cgit v1.2.3