summaryrefslogtreecommitdiff
path: root/public/once
diff options
context:
space:
mode:
authorroot@culturestrings <root@culturestrings>2020-06-20 09:38:13 +0000
committerroot@culturestrings <root@culturestrings>2020-06-20 09:38:13 +0000
commit065c23e1561fad50c66c30447a4886d2727a47cf (patch)
treefb059d4508fae8df620043a485b5c6672cffdabf /public/once
parent281232b3c94181232a350f7162475c6ac9704d43 (diff)
downloadculturestrings-065c23e1561fad50c66c30447a4886d2727a47cf.tar.bz2
culturestrings-065c23e1561fad50c66c30447a4886d2727a47cf.tar.xz
opendkim: added configuration, one-time setup, and postfix integration.
Diffstat (limited to 'public/once')
-rwxr-xr-xpublic/once/opendkim20
1 files changed, 20 insertions, 0 deletions
diff --git a/public/once/opendkim b/public/once/opendkim
new file mode 100755
index 0000000..fb088c8
--- /dev/null
+++ b/public/once/opendkim
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -eu
+
+smtphost="$1"
+
+if [ -f /etc/dkimkeys/mail.private ]; then
+ printf '%s: %s %s\n' "$0" \
+ "dkim key file /etc/dkimkeys/mail.private" \
+ "already exists! Aborting..." >&2
+ exit 2
+fi
+
+opendkim-genkey -r -S -v -b 2048 -D /etc/dkimkeys -d $smtphost -s mail
+chown -R opendkim:opendkim /srv/etc/dkimkeys
+
+mkdir -p -m o-rwx /var/spool/postfix/opendkim
+chown -R opendkim:opendkim /var/spool/postfix/opendkim
+
+usermod --group opendkim --append postfix