[CentOS] Up to date guide/information Sendmail SMTP Auth

Wed Mar 8 16:00:06 UTC 2017
Paul Heinlein <heinlein at madboa.com>

On Wed, 8 Mar 2017, Mark Weaver wrote:

> Hello all,
>
> I've been googling my brains out since yesterday looking for up-to-date 
> information on this matter, and have found information that is anywhere from 
> 15 to 5 years old. I'd really like some information that much more up to date 
> on the subject. Specifically configuring Sendmail SMTP authentication (_no 
> smart host stuff_).

I wrote this article years ago:

   https://www.madboa.com/geek/sendmail-auth/

The configuration outlined there is essentially unchanged today. I 
have it running on a CentOS 7 machine with sendmail 8.14.

The only real change is the SOCKETDIR setting in 
/etc/sysconfig/saslauthd, which is now /run/saslauthd (rather than 
/var/run/saslauthd). And, of course, I use systemctl rather than 
chkconfig to control boot-time behavior.

The trickier bit for me was stopping and restarting the whole SMTP 
toolchain, which includes spamassassin, clavav, and opendmarc. Below 
my .sig, I've included the shell script I use for that.

-- 
Paul Heinlein <> heinlein at madboa.com <> http://www.madboa.com/


#!/bin/sh
#
# start/stop SMTP tool chain on mail.madboa.com
#
======================================================================

LANG=C
PATH="/usr/bin:/usr/sbin"

function mail_start {
   sync && sync
   for S in \
     "clamd at clayton" "clamav-milter" \
     "opendmarc" \
     "spamassassin" "spamass-milter" \
     "sendmail"
   do
     echo -n "Starting $S :: "
     systemctl start ${S}.service
     if test $? -eq 0; then echo "ok"; else echo "failed"; fi
   done
}

function mail_status {
   for S in \
     "clamd at clayton" "clamav-milter" \
     "opendmarc" \
     "spamassassin" "spamass-milter" \
     "sendmail"
   do
     echo -n "$S :: "
     systemctl is-active ${S}.service
   done
}

function mail_stop {
   for S in \
     "sendmail" \
     "clamav-milter" "clamd at clayton" \
     "opendmarc" \
     "spamass-milter" "spamassassin"
   do
     echo -n "Stopping $S :: "
     systemctl stop ${S}.service
     if test $? -eq 0; then echo "ok"; else echo "failed"; fi
   done
}

case "$1" in
   start)
     mail_start
     ;;
   stop)
     mail_stop
     ;;
   restart)
     mail_stop
     mail_start
     ;;
   status)
     mail_status
     ;;
   *)
     echo "usage: $(basename $0) {start|stop|restart|status}"
     ;;
esac

# vim: set filetype=sh: