summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rw-r--r--opendkim.sh24
2 files changed, 25 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index b480cff..0c06c0b 100644
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,7 @@ HOOKS= apache24.sh \
chrony.sh \
named.sh \
nginx.sh \
+ opendkim.sh \
pf.sh \
postfix.sh \
unbound.sh
diff --git a/opendkim.sh b/opendkim.sh
new file mode 100644
index 0000000..d4f0111
--- /dev/null
+++ b/opendkim.sh
@@ -0,0 +1,24 @@
+# This source code is released into the public domain.
+#
+# The OpenDKIM internal.ldap file is just a list of prefixes, one per line.
+
+OPENDKIM_FILE="/usr/local/etc/mail/internal.ldap"
+OPENDKIM_TEMP="${OPENDKIM_FILE}.ldaptmp"
+
+if [ ! -f "$OPENDKIM_FILE" ]; then
+ exit 0
+fi
+
+awk <"$NETWORKS_FILE" >"$OPENDKIM_TEMP" '{ print $1 }'
+
+if cmp -s "$OPENDKIM_TEMP" "$OPENDKIM_FILE"; then
+ rm "$OPENDKIM_TEMP"
+ exit 0
+fi
+
+printf '%s updated:\n\n' "$OPENDKIM_FILE"
+diff "$OPENDKIM_FILE" "$OPENDKIM_TEMP"
+printf '\n'
+
+mv "$OPENDKIM_TEMP" "$OPENDKIM_FILE"
+/usr/local/etc/rc.d/milter-opendkim reload