Mod:Postfix fixed PHP cfg Update & motd warn msgs

This commit is contained in:
2021-02-05 18:39:35 +01:00
parent 616f0a2162
commit 4ff12369d6
2 changed files with 7 additions and 6 deletions

View File

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

View File

@@ -69,16 +69,16 @@ sed -i -e 's/DOMAINname/'$hostname'/' -e 's/SITEName/'host'/' -e 's/vps/'$odksec
unset odksec unset odksec
cat << EOF > /etc/update-motd.d/51-generalSPF cat << EOF > /etc/update-motd.d/51-generalspf
#!/bin/sh #!/bin/sh
red='\e[1;31m%s\e[0m\n' red='\e[1;31m%s\e[0m\n'
printf "\n" printf "\n"
printf \$red "To enable mail for this server add \"ip4:\$(curl -s -4 icanhazip.com) ip6:\$(curl -s -6 icanhazip.com)\" to $hostname SPF" printf \$red "To enable mail for this server add \"ip4:\$(curl -s -4 icanhazip.com) ip6:\$(curl -s -6 icanhazip.com)\" to $hostname SPF"
printf \$red "to enable DKKIM for the hostname run bash ~/OpenDKIMInit-host.sh" printf \$red "to enable DKKIM for the hostname run bash ~/OpenDKIMInit-host.sh"
printf \$red "remove notice this by running \"rm /etc/update-motd.d/51-generalSPF\"" printf \$red "remove notice this by running \"rm /etc/update-motd.d/51-generalspf\""
printf "\n" printf "\n"
EOF EOF
chmod +x /etc/update-motd.d/51-generalSPF chmod +x /etc/update-motd.d/51-generalspf
systemctl start postfix opendkim systemctl start postfix opendkim
systemctl enable postfix opendkim systemctl enable postfix opendkim