Advertisement
Guest User

Untitled

a guest
Jul 1st, 2017
563
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. apt-get install ssmtp mailutils
  2.  
  3. rm -r /etc/ssmtp/ssmtp.conf
  4. nano /etc/ssmtp/ssmtp.conf
  5.  
  6.  
  7. GMAIL CONFIG
  8. ***********************************************
  9.  
  10. # The user that gets all the mails (UID < 1000, usually the admin)
  11. root=noreply@xxxxxxxxxxxxxxx
  12.  
  13. # The mail server (where the mail is sent to), both port 465 or 587 should be acceptable
  14. # See also https://support.google.com/mail/answer/78799
  15. mailhub=smtp.gmail.com:587
  16.  
  17. # The address where the mail appears to come from for user authentication.
  18. rewriteDomain=gmail.com
  19.  
  20. # The full hostname
  21. hostname=localhost
  22.  
  23. # Use SSL/TLS before starting negotiation
  24. UseTLS=Yes
  25. UseSTARTTLS=Yes
  26.  
  27. # Username/Password
  28. AuthUser=xxxxxxxxxxxxxxxxxxxxx
  29. AuthPass=xxxxxxxxxxxxxx
  30. AuthMethod=LOGIN
  31.  
  32. # Email 'From header's can override the default domain?
  33. FromLineOverride=yes
  34.  
  35. ***********************************************
  36.  
  37.  
  38.  
  39.  
  40. add
  41. root:xxxxx@gmail.com:smtp.gmail.com:587
  42. youruser:xxxxxx@gmail.com:smtp.gmail.com:587
  43.  
  44.  
  45.  
  46.  
  47.  
  48. ******IMPORTANT****
  49. send-mail: Authorization failed
  50.  
  51. Take the step mentioned earlier.
  52. Log into your google email account and then go to this link: https://www.google.com/settings/security/lesssecureapps and set "Access for less secure apps" to ON.
  53. Test to see if your issue is resolved. If it isn't resolved, as it wasn't for me, continue to Step #2.
  54.  
  55. https://accounts.google.com/b/0/DisplayUnlockCaptcha
  56.  
  57. echo test | mail -v -s "testing ssmtp setup" xxxxxxxxxxxxx@gmail.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement