About Linux FAQ

Browse More FAQs:

Configure Sendmail SSL encryption for sending and receiving email

Posted by Vivek Gite [Last updated: December 4, 2006]

Q. How do I configure Sendmail email server to use SSL encryption for sending/receiving email? I have already obtained or received the required valid SSL certificate. It is stored in /etc/mail/ssl directory as follows:

SSL Keys and Certification files
=> /etc/mail/ssl/sendmail.pem
=> /etc/mail/ssl/ca-bundle.crt

Now how do I configure sendmail for SSL under Fedora Core or RHEL or Cent OS?

A. Sendmail is a mail transfer agent (MTA) and you need a valid SSL certificate on the server. Sendmail remains the most popular MTA on the Internet, although this is probably fading. Its popularity is due in part to its position as the standard MTA under most variants of the Unix operating system.

Sendmail can be configured to encrypt email via the secure socket layer (SSL) when you want to send and receives emails.

Open sendmail configuration file /etc/mail/sendmail.mc using text editor such as vi:
# vi /etc/mail/sendmail.mc

Now append/modify following directives:
define(`confCACERT_PATH',`/etc/mail/ssl/certs')
define(`confCACERT',`/etc/mail/ssl/ca-bundle.crt')
define(`confSERVER_CERT',`/etc/mail/ssl/sendmail.pem')
define(`confSERVER_KEY',`/etc/mail/ssl/sendmail.pem')

And make sure port is set to smtps (secure smtp i.e. port 465):
DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl


Restart sendmail and secure pop3s/imaps

Type the following commands to restart sendmail and related services:
# /etc/init.d/sendmail restart
# chkconfig pop3s on
# chkconfig imaps on
# /etc/init.d/xinetd restart

pop3s and imaps will start from xinetd

How do I generate certificates locally for testing purpose only?

If you don't have certificates you can generates certificates locally on Cent OS/RHEL/Fedora Core. Type the following commands:
# cd /usr/share/ssl/certs
# make sendmail.pem

Now open sendmail /etc/mail/sendmail.mc config file and append/modify directives as follows:
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

Restart sendmail as discussed above.

E-mail this to a friend      Printable version

Related Other Helpful FAQs:

Discussion on This FAQ

  1. Nandkishor Says:

    Hi,
    my qmailserver is at out of location. All users sending & receiving the mails through this server.
    It is possible to setup the fetching sendmail server to local. All users are send & received the mail through this server & not directlay connected to outside server qmail server for send & received the mails.
    Hoiw I configurd this fetchning mail server.

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.