Ssmtp: Difference between revisions
From James's Wiki
(Created page with "=Setup SSMTP to work with your gmail account on a Raspberry PI 3 (stretch)= Make sure you have ssmtp installed, if not then <code>sudo apt-get install ssmtp</code> sudo nan...") |
No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
sudo nano /etc/ssmtp/ssmtp.conf | sudo nano /etc/ssmtp/ssmtp.conf | ||
Edit you ssmtp.conf file to look like this: | |||
# | # | ||
# Config file for sSMTP sendmail | # Config file for sSMTP sendmail | ||
Line 10: | Line 11: | ||
# The person who gets all mail for userids < 1000 | # The person who gets all mail for userids < 1000 | ||
# Make this empty to disable rewriting. | # Make this empty to disable rewriting. | ||
root= | root=<youremail@somewhere.com | ||
# The place where the mail goes. The actual machine name is required no | # The place where the mail goes. The actual machine name is required no | ||
Line 20: | Line 21: | ||
# The full hostname | # The full hostname | ||
hostname= | hostname=<hostname of your serve here> | ||
# Are users allowed to set their own From: address? | # Are users allowed to set their own From: address? | ||
Line 29: | Line 30: | ||
AuthUser=<yourgmailaccount>@gmail.com | AuthUser=<yourgmailaccount>@gmail.com | ||
AuthPass=<your app password> | AuthPass=<your app password> | ||
==Setup an app password with gmail== | |||
https://security.google.com/settings/security/apppasswords | |||
==Test it== | |||
echo "Test message from Linux server using ssmtp" | sudo ssmtp -vvv destination-email-address@some-domain.com |
Latest revision as of 01:43, 25 February 2018
Setup SSMTP to work with your gmail account on a Raspberry PI 3 (stretch)
Make sure you have ssmtp installed, if not then sudo apt-get install ssmtp
sudo nano /etc/ssmtp/ssmtp.conf
Edit you ssmtp.conf file to look like this:
# # Config file for sSMTP sendmail # # The person who gets all mail for userids < 1000 # Make this empty to disable rewriting. root=<youremail@somewhere.com # The place where the mail goes. The actual machine name is required no # MX records are consulted. Commonly mailhosts are named mail.domain.com mailhub=smtp.gmail.com:587 # Where will the mail seem to come from? #rewriteDomain= # The full hostname hostname=<hostname of your serve here> # Are users allowed to set their own From: address? # YES - Allow the user to specify their own From: address # NO - Use the system generated From: address FromLineOverride=YES UseSTARTTLS=YES AuthUser=<yourgmailaccount>@gmail.com AuthPass=<your app password>
Setup an app password with gmail
https://security.google.com/settings/security/apppasswords
Test it
echo "Test message from Linux server using ssmtp" | sudo ssmtp -vvv destination-email-address@some-domain.com