From 4252c8ac2bdb3ad096c23f53839c5c6dd62d2731 Mon Sep 17 00:00:00 2001 From: patnal Date: Mon, 14 Oct 2024 12:58:56 +0200 Subject: [PATCH] Update 14-config-rspamd.sh DKIM selector adding support for proper DKIM selector setup into dkim_signing.conf --- rootfs/etc/cont-init.d/14-config-rspamd.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rootfs/etc/cont-init.d/14-config-rspamd.sh b/rootfs/etc/cont-init.d/14-config-rspamd.sh index c7676ca..ed31c89 100755 --- a/rootfs/etc/cont-init.d/14-config-rspamd.sh +++ b/rootfs/etc/cont-init.d/14-config-rspamd.sh @@ -12,10 +12,14 @@ if [ ! -f "$DKIM_PRIVATE_KEY" ]; then echo "WRN: $DKIM_PRIVATE_KEY not found. Rspamd service disabled." exit 0 fi +if [ -z "$ANONADDY_DKIM_SELECTOR" ]; then + export ANONADDY_DKIM_SELECTOR="default" + echo "INFO: DKIM selector not set, using default." +fi echo "Copying DKIM private key for Rspamd" mkdir -p /var/lib/rspamd/dkim -cp -f "${DKIM_PRIVATE_KEY}" "/var/lib/rspamd/dkim/${ANONADDY_DOMAIN}.default.key" +cp -f "${DKIM_PRIVATE_KEY}" "/var/lib/rspamd/dkim/${ANONADDY_DOMAIN}.${ANONADDY_DKIM_SELECTOR}.key" echo "Setting Rspamd dkim_signing.conf" cat >/etc/rspamd/local.d/dkim_signing.conf <