Skip to content

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

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
# /etc/ssmtp.conf -- a config file for sSMTP sendmail.
# See the ssmtp.conf(5) man page for a more verbose explanation of the
# available options.

# The person who gets all mail for userids < 500
# Make this empty to disable rewriting.

# The place where the mail goes. The actual machine name is required
# no MX records are consulted. Commonly mailhosts are named
# The example will fit if you are in and your mailhub is so named.

# Example for SMTP port number 2525
# mailhub=mail.your.domain:2525
# Example for SMTP port number 25 (Standard/RFC)
# mailhub=mail.your.domain
# Example for SSL encrypted connection
# mailhub=mail.your.domain:465

# Where will the mail seem to come from?

# The full hostname

# Set this to never rewrite the "From:" line (unless not given) and to
# use that address in the "from line" of the envelope.

# Use SSL/TLS to send secure messages to server.

# Use SSL/TLS certificate to authenticate against smtp host.

# Use this RSA certificate.

# Get enhanced (*really* enhanced) debugging information in the logs
# If you want to have debugging of the config file parsing, move this option
# to the top of the config file and uncomment