July 28, 2014

Installing SSMTP on CentOS 5.6

CentOS Logo This tutorial will guide you through installing SSMTP on CentOS 5.6

SSMTP is an extremely simple MTA to get mail off the system to a mail hub. It contains no suid-binaries or other dangerous things – no mail spool to poke around in, and no daemons running in the background. Mail is simply forwarded to the configured mailhost. Extremely easy configuration. WARNING: the above is all it does; it does not receive mail, expand aliases or manage a queue.

Firstly lets install the EPEL repository as SSMTP is not native to CentOS 5.6 base installations.

Install the EPEL i386 YUM Repository

# rpm -Uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

Remove Sendmail as the binaries can conflict.

# yum remove sendmail

Now install SSMTP

# yum install ssmtp

SSMTP is now installed and all that is let is to configure it.

For a really basic installation uncomment and replace with your mailserver and domain details mailhub and RewriteDomain

# cp /etc/ssmtp/ssmtp.conf /etc/ssmtp/ssmtp.conf.orig
# vi /etc/ssmtp/ssmtp.conf

  • Anonymous

    Thanks so much for this nhttp://www.webpacket.co.zan

  • Cwhitmore

    easy setup. thanks.

  • http://twitter.com/Mc_Flea Shaheen McLean

    If you want to use sSMTP to use Gmail/Google Apps as the relay host for yourdomain.com, use the following config:

    mailhub=smtp.gmail.com:587
    RewriteDomain=yourdomain.com

    FromLineOverride=YES (uncomment this line)

    UseSTARTTLS=YES (do not use UseTLS=YES which is the default, there’ll be errors)

    AuthUser=user@yourdomain.com
    AuthPass=YourPasswordGoesHere

    If you’re using a PHP mail wrapper set this line in your /etc/php.ini:
    sendmail_path = /usr/sbin/ssmtp -t