Scotech Scotech
Knowledge Base
[ Home | KB | Tools | Requests? ]


Sendmail over SSL (TLS) Encryption


First you need to create the server's SSL certificate.

cd /usr/share/ssl/certs
make sendmail.pem

Configure the sendmail.mc file to support SMTP over SSL (TLS).

vi /etc/mail/sendmail.mc
#---
define(`confCACERT_PATH',`/usr/share/ssl/certs')
define(`confCACERT',`/usr/share/ssl/certs/ca-bundle.crt')
define(`confSERVER_CERT',`/usr/share/ssl/certs/sendmail.pem')
define(`confSERVER_KEY',`/usr/share/ssl/certs/sendmail.pem')
DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl
#---

Compiled the sendmail.cf file and restart Sendmail services.

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
service sendmail restart

If you run the iptables firewall, open the necessary hole.

vi /etc/sysconfig/iptables
#---
-A [name] -m state --state NEW -m tcp -p tcp --dport 465 -j ACCEPT
#---
service iptables restart

You can now send your SMTP emails securely with SSL encryption. Although keep in mind this only guarantees an SSL connection between your client and server. If you want to guarantee encryption between SMTP servers, further Sendmail configuration is necessary.

- Scotech



[ Home | KB | Tools | Email: info@scotech.com ]

© 1996-2010 Scotech. All rights reserved.