summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLexi Winter <lexi@le-fay.org>2025-07-12 13:33:05 +0100
committerLexi Winter <lexi@le-fay.org>2025-07-12 13:33:05 +0100
commitab97b60b8f36ea153d4f29a3c5519bdb340661d2 (patch)
tree6a19a2bf4c44d5fb44ce3332b3e82ec9010c140e
parentc0cd1c346ced206c1822721bc09fdf45c602cbfd (diff)
downloadlfldap-1.4.tar.gz
lfldap-1.4.tar.bz2
add an OpenDKIM hookv1.4
-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