Overview
sSMTP – a simple and lightweight MTA used to deliver mail from a computer to a mail hub (SMTP server) using Gmail SMTP servers.
Unlike Exim4, it does not receive mail, expand aliases, or manage a queue.
Requirements
First you need to stop sendmail if it is installed:
1 2 | service sendmail stop chkconfig sendmail off |
Add the CentOS EPEL repository:
Download and install epel-release-6-8.noarch.rpm:
1 2 3 | wget http://ftp.astral.ro/mirrors/fedora/pub/epel/6/i386/epel-release-6-8.noarch.rpm rpm -Uvh epel-release-6-8.noarch.rpm yum update |
Install and Configure sSMTP
1 | yum instal ssmtp |
Edit /etc/ssmtp/ssmtp.conf:
1 2 3 4 5 6 7 | FromLineOverride=YES root=username@gmail.com mailhub=smtp.gmail.com:587 UseTLS=YES UseSTARTTLS=YES AuthUser=username AuthPass=<a href="http://support.google.com/a/bin/answer.py?hl=en&answer=175197">we suggest creating an app password with gmail 2 step authentication</a>. |
Change to default MTA
Usually we ave sendmail as the main MTA, we need to change it:
1 | alternatives --config mta |
select /usr/sbin/sendmail.ssmtp.
Enjoy.
DevOps/IT Specialist, Musician.
IT Manager – Faculty of Exact Sciences, Bar-Ilan University
Personal Website