email.sh 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/bin/sh
  2. echo '
  3. __ __ _ _
  4. | \/ |__ _(_) |
  5. | |\/| / _` | | |
  6. |_| |_\__,_|_|_|
  7. '
  8. echo "Enable mail sending for php"
  9. . bin/checkroot.sh
  10. # get the current position
  11. _cwd="$(pwd)"
  12. # check for assets forlder
  13. _assets="$_cwd/assets"
  14. if [ ! -d "$_assets" ]; then
  15. _assets="$_cwd/../assets"
  16. if [ ! -d "$_assets" ]; then
  17. echo "!! can't find assets directory !!"
  18. exit
  19. fi
  20. fi
  21. # http://www.sycha.com/lamp-setup-debian-linux-apache-mysql-php#anchor13
  22. sleep 2
  23. apk add mailx postfix
  24. mkdir /var/mail
  25. postmap /etc/postfix/aliases
  26. rc-update add postfix
  27. /etc/init.d/postfix start
  28. # dkim spf
  29. # echo "\033[35;1mConfiguring DKIM \033[0m"
  30. # while [ "$installdkim" != "y" ] && [ "$installdkim" != "n" ]
  31. # do
  32. # echo -n "Should we install dkim for exim4 ? [y|n] "
  33. # read installdkim
  34. # done
  35. # if [ "$installdkim" = "y" ]; then
  36. # echo -n "Choose a domain for dkim (same domain as you chose before for exim4): "
  37. # read domain
  38. # selector=$(date +%Y%m%d)
  39. #
  40. # mkdir /etc/exim4/dkim
  41. # openssl genrsa -out /etc/exim4/dkim/"$domain"-private.pem 1024 -outform PEM
  42. # openssl rsa -in /etc/exim4/dkim/"$domain"-private.pem -out /etc/exim4/dkim/"$domain".pem -pubout -outform PEM
  43. # chown root:Debian-exim /etc/exim4/dkim/"$domain"-private.pem
  44. # chmod 440 /etc/exim4/dkim/"$domain"-private.pem
  45. #
  46. # cp "$_assets"/exim4_dkim.conf /etc/exim4/conf.d/main/00_local_macros
  47. # sed -i -r "s/DOMAIN_TO_CHANGE/$domain/g" /etc/exim4/conf.d/main/00_local_macros
  48. # sed -i -r "s/DATE_TO_CHANGE/$selector/g" /etc/exim4/conf.d/main/00_local_macros
  49. #
  50. # update-exim4.conf
  51. # systemctl restart exim4
  52. # echo "please create a TXT entry in your dns zone : $selector._domainkey.$domain \n"
  53. # echo "your public key is : \n"
  54. # cat /etc/exim4/dkim/"$domain".pem
  55. # echo "press any key to continue."
  56. # read continu
  57. # else
  58. # echo 'dkim not installed'
  59. # fi