email.sh 1.9 KB

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