Files
VPS-scripts_Web-V2/SubModules/postfix/opendkim-init.sh
Bram Prieshof 73bf0aa0f4 Mod:Postfix Made DKIM selector variable
This so multiple servers useing Web-V2 can send from the same domain
Now using odksec for host selector var
and odkdomsec for domain selector var
2021-03-12 14:44:40 +01:00

36 lines
1.1 KiB
Bash

if [ -n "$1" ]; then
if [[ "$1" = "--enable" ]]; then
echo "Enableing DKIM"
echo "*@DOMAINname ODKSec._domainkey.DOMAINname" >>/etc/opendkim.d/SigningTable
systemctl reload opendkim
#Remove script
while true; do
read -p "Remove this script -> yes/no?" yn
case $yn in
[Nn]* )
break;;
[Yy]* )
rm -- "$0"
break;;
* )echo "Choose yes or no.";;
esac
done
exit
fi
fi
echo "Required to enable mailing for this system"
echo "Please add the folloing to your SPF Record in the DNS of DOMAINname"
echo ""
echo "Optional to enable dkim"
echo "ip4:$(curl -s -4 icanhazip.com) ip6:$(curl -s -6 icanhazip.com)"
echo "Please add the folloing TXT Record to the DNS of DOMAINname"
echo "WARNING the output is split, please combine key before inserting into DNS"
cat /etc/opendkim.d/keys/DOMAINname/ODKSec.txt
echo ""
echo "If DNS is propegated then run \"bash $0 --enable\""
rm -f /etc/update-motd.d/51-opendkim-SITEName