Last active
July 4, 2022 19:32
-
-
Save hasenbalg/60cb5024eace27ea9abf17db70b3931e to your computer and use it in GitHub Desktop.
Setup Gmail in Ubuntu 18.04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EMAIL_ADDRESS=**** | |
DOMAIN=**** | |
SMTP_SERVER=****:587 | |
PASSWORD=**** | |
sudo apt-get update | |
sudo apt-get install ssmtp -y | |
sudo cat <<EOT >> /etc/ssmtp/ssmtp.conf | |
root=$EMAIL_ADDRESS | |
mailhub=$SMTP_SERVER | |
AuthUser=$EMAIL_ADDRESS | |
AuthPass=$PASSWORD | |
UseTLS=NO | |
UseSTARTTLS=YES | |
rewriteDomain=$DOMAIN | |
hostname=$(hostname) | |
FromLineOverride=NO | |
EOT | |
echo "root:$EMAIL_ADDRESS:$SMTP_SERVER" | sudo tee -a /etc/ssmtp/revaliases | |
echo "mainuser:$EMAIL_ADDRESS:$SMTP_SERVER" | sudo tee -a /etc/ssmtp/revaliases | |
echo "Test message from Linux server using ssmtp" | sudo ssmtp -vvv $EMAIL_ADDRESS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment