Much like enabling SSL, confuring Sendmail to use authentication was much easier than I first thought. The hardest part was locating some decent instructions to do it. Fortunataly I eventually came across some here. It looks like they were written for RedHat 7.x but seem to work for 8.0. Basically I just had to modify my /etc/mail/sendmail.mc file and then update my /etc/mail/sendmail.cf file. Here’s the step by step process:
backed up my configuration files:
cp /etc/mail/sendmail.mc /etc/mail/sendmail.mc.bak
cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.bak
added to /etc/mail/sendmail.mc (NOTE: Watch the directed quotes. The first quote is made using the key just above the TAB key, the other is a normal apostrophe):
define(`confAUTH_OPTIONS’, `A’)dnl
TRUST_AUTH_MECH(`DIGEST-MD5 CRAM-MD5 LOGIN PLAIN’)dnl
define(`confAUTH_MECHANISMS’, `DIGEST-MD5 CRAM-MD5 LOGIN PLAIN’)dnl
Updated the configuration file:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
Restarted sendmail:
/etc/rc.d/init.d/sendmail restart
Verified it worked:
telnet 127.0.0.1 25
EHLO localhost
250-SERVERNAME Hello CLIENT NAME [CLIENTIP], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH LOGIN PLAIN
250-STARTTLS
250-DELIVERBY
250 HELP
The 250-AUTH LOGIN PLAIN indicates that everything seems to be working. I modified my mail client to use authentication and sent myself a test email (to an email account located on a different domain, to require relaying). I received the email just fine. Just to be safe I then turned off authentication in my mail client and tried to send the same email and received the ever popular “relaying denied” error (error messages aren’t so bad when I intend to get them).
I also wanted to verify that no user or password information was getting sent in cleartext. So I enabled authentication in the mail client again, sent myself another test email and sniffed the network traffic (have I ever mentioned how much I love ethereal?). I monitored the whole transaction between the client and the server. The SSL/TLS authentication was successful after which all content was encrypted. So, I think the mail system is finally to a point I’m satisfied with.