Advertisement
h3x3r0

Untitled

Dec 30th, 2022 (edited)
1,220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.16 KB | None | 0 0
  1. #!/bin/bash
  2. domain="$1"
  3. selector="$2"
  4. yum --nogpgcheck -y install dkim-milter
  5. cd /etc/mail/dkim-milter/keys
  6. mkdir $domain
  7. cd $domain
  8. dkim-genkey -r -d $domain -s $selector
  9. cd ..
  10. chown -R dkim-milter:dkim-milter $domain
  11. chmod -R 600 ${domain}/*
  12. echo *:${domain}:/etc/mail/dkim-milter/keys/${domain}/${selector} > /etc/mail/dkim-milter/keys/keylist
  13. #sed -i "s/Socket/#Socket/g" /etc/mail/dkim-milter/dkim-filter.conf
  14. #echo Syslog yes >> /etc/mail/dkim-milter/dkim-filter.conf
  15. #echo SyslogFacility mail >> /etc/mail/dkim-milter/dkim-filter.conf
  16. #echo Socket inet:8891@localhost >> /etc/mail/dkim-milter/dkim-filter.conf
  17. echo 127.0.0.1 > /etc/mail/dkim-milter/hosts
  18. #echo InternalHosts /etc/mail/dkim-milter/hosts >> /etc/mail/dkim-milter/dkim-filter.conf
  19. echo milter_default_action = accept >> /etc/postfix/main.cf
  20. echo milter_protocol = 2 >> /etc/postfix/main.cf
  21. echo smtpd_milters = inet:localhost:8891 >> /etc/postfix/main.cf
  22. echo non_smtpd_milters = inet:localhost:8891 >> /etc/postfix/main.cf
  23. service dkim-milter restart
  24. service postfix restart
  25. echo "Use the following information to your DNS records:"
  26. cat /etc/mail/dkim-milter/keys/${domain}/${selector}.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement