summaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2024-06-19 03:01:09 -0400
committerMalfurious <m@lfurio.us>2024-07-09 15:50:39 -0400
commit08b83d5142f093a60ea2dfaeb9014a5831a1480b (patch)
tree85c9c55d6e7e27f6a3df03c5779549289608ce9e /Dockerfile
parent335b9f49532ce012b6da7dc404aff1dee55bfa21 (diff)
downloadmailnode-08b83d5142f093a60ea2dfaeb9014a5831a1480b.tar.gz
mailnode-08b83d5142f093a60ea2dfaeb9014a5831a1480b.zip
opendkim: Generate keys / TXT record
Keys are generated using the config from the previous commit and stored in the dkim data volume. The key length is set to 1024 bits for compatibility with nameservers. See this quote from the opendkim readme: BIND servers have a 256 byte limit on serving TXT records, so a 1024 bit RSA key is recommended if using BIND as your primary DNS server. Signed-off-by: Malfurious <m@lfurio.us>
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile12
1 files changed, 12 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
index aa35a8f..aa7c1ca 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -46,6 +46,18 @@ RUN apt update \
sudo \
&& apt clean
+# Generate OpenDKIM keypair
+# Do this here so we can print the pubkey/dns record to logs during build
+# process. After initial run, a volume should preserve the keys for later
+# runs.
+RUN mkdir -p /opendkim \
+ && chown opendkim:opendkim /opendkim \
+ && opendkim-genkey \
+ --bits=1024 \
+ --directory=/opendkim \
+ --selector=default \
+ && cat /opendkim/default.txt
+
# Install files
COPY dovecot /etc/dovecot/
COPY opendkim /etc/