Skip to content

Commit

Permalink
refs #39444, allow domain being dynamic added into dkim signing table…
Browse files Browse the repository at this point in the history
…/key table
  • Loading branch information
jimyhuang committed Mar 6, 2024
1 parent ea0c20f commit f186de1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions container/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,22 @@ if [ -n "$mailaddr" ]; then
fi
done
fi

dkimaddr=`cat /home/vmail/dkimaddr`
if [ -n "$dkimaddr" ]; then
while read -r dkimdomain
do
if [[ -z "$dkimdomain" ]]; then
continue
fi
if [[ -f "/etc/opendkim/globalkey.private" ]]
then
grep -qF "*@$dkimdomain $dkimp._domainkey.$dkimdomain" /etc/opendkim/SigningTable || echo -e "*@$dkimdomain $dkimp._domainkey.$dkimdomain\n$(cat /etc/opendkim/SigningTable)" > /etc/opendkim/SigningTable
grep -qF "$dkimp._domainkey.$dkimdomain $dkimdomain:$dkimp:/etc/opendkim/globalkey.private" /etc/opendkim/KeyTable || echo "$dkimp._domainkey.$dkimdomain $dkimdomain:$dkimp:/etc/opendkim/globalkey.private" >> /etc/opendkim/KeyTable
fi
done < /home/vmail/dkimaddr
fi

chmod 640 /home/vmail/tmp/*
if [ -f /home/vmail/passwd ]; then
chown root:dovecot /etc/dovecot/passwd
Expand Down

0 comments on commit f186de1

Please sign in to comment.