Network & Academic Computing Services
Security


Turning off Sendmail


Sendmail is invoked from varying places on different UNIX variants. Here are some examples:

  • Solaris 2: /etc/rc3.d/S40sendmail
  • Red Hat Linux 4.2: /etc/rc.d/init.d/sendmail.init
  • IRIX: /etc/init.d/mail
  • Tru64 UNIX: /sbin/init.d/sendmail
  • SunOS 4.1.x: /etc/rc.local
You will need to comment out the sendmail invocation in the appropriate file for your UNIX variant.
A "#" at the beginning of the line should take care of it.


Example from /etc/rc3.d/S40sendmail (Solaris):

case "$1" in
'start')
   if [ -f /usr/lib/sendmail -a -f /etc/mail/sendmail.cf ]; then
	  if [ ! -d /var/spool/mqueue ]; then
	    /usr/bin/mkdir -m 0750 /var/spool/mqueue
	       /usr/bin/chown root:bin /var/spool/mqueue
	  fi
	  #/usr/lib/sendmail -bd -q15m &
   fi

Notice the "#" before /usr/lib/sendmail. This will prevent sendmail from starting.

You will want to add a root crontab entry to periodically check the /var/spool/mqueue directory for undelivered mail.
Add the following entry to the /var/spool/cron/crontabs/root file.
     0,15,30,45 * * * * /usr/lib/sendmail -q



dcs@uci.edu

Network & Academic Computing Services > Support > Security > Securing a UNIX Machine

Updated: August 6, 2003

University of California, Irvine