dkim spf email validation for exim4
This commit is contained in:
parent
29b798b58d
commit
824e084946
4
assets/exim4_dkim.conf
Normal file
4
assets/exim4_dkim.conf
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
DKIM_CANON = relaxed
|
||||||
|
DKIM_SELECTOR = DATE_TO_CHANGE
|
||||||
|
DKIM_DOMAIN = DOMAIN_TO_CHANGE
|
||||||
|
DKIM_FILE = /etc/exim4/dkim/DOMAIN_TO_CHANGE-private.pem
|
@ -141,6 +141,42 @@ echo "\033[35;1mEnable mail sending for php \033[0m"
|
|||||||
# http://www.sycha.com/lamp-setup-debian-linux-apache-mysql-php#anchor13
|
# http://www.sycha.com/lamp-setup-debian-linux-apache-mysql-php#anchor13
|
||||||
sleep 3
|
sleep 3
|
||||||
dpkg-reconfigure exim4-config
|
dpkg-reconfigure exim4-config
|
||||||
|
service exim4 restart
|
||||||
|
|
||||||
|
# dkim spf
|
||||||
|
# https://debian-administration.org/article/718/DKIM-signing_outgoing_mail_with_exim4
|
||||||
|
echo "\033[35;1mConfiguring DKIM \033[0m"
|
||||||
|
while [ "$installdkim" != "y" ] && [ "$installdkim" != "n" ]
|
||||||
|
do
|
||||||
|
echo -n "Should we install dkim for exim4 ? [y|n] "
|
||||||
|
read installdkim
|
||||||
|
done
|
||||||
|
if [ "$installdkim" = "y" ]; then
|
||||||
|
echo -n "Choose a domain for dkim: "
|
||||||
|
read domain
|
||||||
|
selector=$(date +%Y%m%d)
|
||||||
|
|
||||||
|
mkdir /etc/exim4/dkim
|
||||||
|
openssl genrsa -out /etc/exim4/dkim/"$domain"-private.pem 1024 -outform PEM
|
||||||
|
openssl rsa -in /etc/exim4/dkim/"$domain"-private.pem -out /etc/exim4/dkim/"$domain".pem -pubout -outform PEM
|
||||||
|
chown root:Debian-exim /etc/exim4/dkim/"$domain"-private.pem
|
||||||
|
chmod 440 /etc/exim4/dkim/"$domain"-private.pem
|
||||||
|
|
||||||
|
cp "$_cwd"/assets/exima4_dkim.conf /etc/exim4/conf.d/main/00_local_macros
|
||||||
|
sed -ir "s/DOMAIN_TO_CHANGE/$domain/g" /etc/exim4/conf.d/main/00_local_macros
|
||||||
|
sed -ir "s/DATE_TO_CHANGE/$selector/g" /etc/exim4/conf.d/main/00_local_macros
|
||||||
|
|
||||||
|
update-exim4.conf
|
||||||
|
service exim4 restart
|
||||||
|
echo "please create a TXT entry in your dns zone : $selector._domainkey.$domain \n"
|
||||||
|
echo "your public key is : \n"
|
||||||
|
cat /etc/exim4/dkim/"$domain".pem
|
||||||
|
echo "press any key to continue."
|
||||||
|
read continu
|
||||||
|
else
|
||||||
|
echo 'dkim not installed'
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo '\033[35m
|
echo '\033[35m
|
||||||
|
Loading…
x
Reference in New Issue
Block a user