Files
VPS-scripts_Web-V2/SubModules/postfix/CMSHook-conf.sh
Bram Prieshof 9c36d12d52 added CMSHook for postfix module and updated conf
CMSHook wil be inplemented so CMS releated Module configuration,
this wil be loaded when using appendCMS and the main intaller
2021-02-04 15:25:57 +01:00

23 lines
1.0 KiB
Bash

#ADD DOMAIN
sudo --user opendkim mkdir /etc/opendkim/keys/"$maildomain"
sudo --user opendkim opendkim-genkey -r -D /etc/opendkim/keys/"$maildomain" -d "$maildomain" -s vps
echo "$maildomain" >> /etc/opendkim/TrustedHosts
echo "vps._domainkey."$maildomain" "$maildomain":vps:/etc/opendkim/keys/"$maildomain"/vps.private" >> /etc/opendkim/KeyTable
if [ $webserv != nginx_nonphp ]; then
echo "php_admin_value[mail.force_extra_parameters] = \"-f$mailas -F'$maildomain'\"" >> "$phpPoolDir"/"$sitename".conf
fi
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/postfix/config/opendkim-init.sh -o ~/OpenDKIMInit-$sitename.sh
sed -i -e 's/DOMAINname/'$domain'/' 's/SITEName/'$sitename'/' ~/OpenDKIMInit-$sitename.sh
cat << EOF > /etc/update-motd.d/51-opendkim-"$sitename"
#!/bin/sh
red='\e[1;31m%s\e[0m\n'
printf "\n"
printf \$red "To enable mail for $domain please run please run bash ~/OpenDKIMInit-$sitename.sh"
printf "\n"
EOF
chmod +x /etc/update-motd.d/51-opendkim-"$sitename"
systemctl reload opendkim $phpFPMService