SSMTP Instead Of Postfix

I am using Ubuntu 16.04 LTS. I was trying to send email from the command line to my Gmail address. So instead of monitoring tools sending info and warning emails to root I want them to arrive in my proper email address.

I tried Postfix but after a month of trying to make it work and looking at mail logs, I give up. I removed it and installed ssmtp instead. The configuration is very simple. Open the file:

#nano /etc/ssmtp/ssmtp.conf

and make sure these appears on the file:

mailhub=smtp.gmailaddress.com:587
Authuser=gmailaddress
Authpass=AppPassword
UseTLS=YES
UseSTARTTLS=YES

Close and save the file. Then test it with:

$echo “Test email for SSMTP” | mail -s “Test Email” gmailaddress.com

Check if you receive the email. If not then you could check the mail logs with:

#tail /var/log/mail.log

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s