User Tools

Site Tools


networking:linux:ssmtp

This is an old revision of the document!


SSMTP

See also Postfix Authenticated Smarthost (does the same thing)

http://www.linux.com/archive/feature/132006

http://www.squad17.org/node/39

SSMTP is a simple replacement for a full MTA such as Sendmail or Postfix.

  • no server daemons
  • no running processes
  • lightweight
  • flexible
  • easier than dealing with an MTA
  • be sure all you need is a simple outbound sendmail command replacement

Installation

See also Using the EPEL Repository

Install ssmtp:

yum install ssmtp --enablerepo=epel

On one older system, mdadm depended on sendmail, I had to do this first:

rpm -e --nodeps sendmail

Configuration

vim /etc/ssmtp/ssmtp.conf

root=adminuser@yourdomain.com
mailhub=mail.yourdomain.com:465
RewriteDomain=yourdomain.com
FromLineOverride=YES
UseTLS=YES
AuthUser=smtpuser
AuthPass=smtppass

Test

If desired, install the mail command:

yum install mailx

update-alternatives --config mta

Send a Test Message

echo test | mail -s "testing ssmtp" tester@yourdomain.com

Or with no mail command and no subject line:

echo test | ssmtp -v tester@yourdomain.com

or

echo test | sendmail -v tester@yourdomain.com

tail -f /var/log/mailog

Another Test

cat << EOF >> /tmp/test.eml
From: MyPBX <smtp@MyPBX>
To: Test <tester@yourdomain.com>
Subject: For test only!


EOF

ssmtp -t < /tmp/test.eml

Change the Default MTA

On Centos:

alternatives --config mta
networking/linux/ssmtp.1380062295.txt.gz · Last modified: 2013/09/24 16:38 by gcooper