INSTALL INSTRUCTIONS

This is basically my HOW-TO install sendmail on a RedHat system with POP before SMTP authorization.  
These instructions were tested and written using various RedHat 5.X to 7.X servers and these exact 
instructions were tested on RedHat 7.3.

UPDATE: These instructions were updated for sendmail-8.12.4 and RedHat 7.2 on April 27, 2002.
UPDATE: These instructions were updated for sendmail-8.12.4 and a patch for vacation on June 17, 2002.
UPDATE: These instructions were updated for sendmail-8.12.5 and tested with RedHat 7.3 on July 25, 2002.
  NOTE: The patch for the bug in vacation we discovered was incorporated in Sendmail 8.12.5 and is no longer needed.
UPDATE: These instructions were updated for sendmail-8.12.6 and patched with smrsh patch on October 4, 2002
UPDATE: Added Privacy Options and Trusted Parameter for HTTPD to sendmail.mc
UPDATE: sendmail source file has correct MD5 checksum per http://www.cert.org/advisories/CA-2002-28.html.  If you used 
        the version we mirror, you do not have the trojan.
UPDATE: sendmail init file on older versions of redhat (pre-8.0) doesn't have the clientmqueue runner. A modified sendmail-init
        tested with RH 7.1

kevin@mcgrail.com

--

#WGET, UNTAR & INSTALL THE VARIOUS SUPPORT DISTRIBUTIONS

#CREATE A TEMP DIR FOR THE TAR FILES
rm -rf /tmp/20021004SENDMAIL/
mkdir /tmp/20021004SENDMAIL/
cd /tmp/20021004SENDMAIL/

#GET ALL THE FILES
wget http://www.peregrinehw.com/downloads/sendmail/current-8.12.X/sendmail-source/sendmail.8.12.6.tar.gz
wget http://www.peregrinehw.com/downloads/sendmail/current-8.12.X/sendmail-source/smrsh-20020924.patch
wget http://www.peregrinehw.com/downloads/sendmail/current-8.12.X/untarred/Linux-OS
wget http://www.peregrinehw.com/downloads/sendmail/current-8.12.X/untarred/popauth.m4
wget http://www.peregrinehw.com/downloads/sendmail/current-8.12.X/untarred/poprelayd-KAM.pl
wget http://www.peregrinehw.com/downloads/sendmail/current-8.12.X/untarred/sendmail.mc


#CLEAR OUT OLD SOURCE
rm -rf /usr/src/sendmail-*

#Uninstall the default sendmail that comes with the OS, but save some of the important files:
  tar cvfz sendmail-save.tar.gz /etc/rc.d/init.d/sendmail /etc/sendmail.cf /etc/aliases /etc/mail/ /etc/pam.d/smtp /etc/sysconfig/sendmail /usr/lib/sasl/Sendmail.conf
  rpm -e sendmail --nodeps

#Build the Source using a few patches and configuration files:
  cd /usr/src/
  tar zxvf /tmp/20021004SENDMAIL/sendmail.8.12.6.tar.gz
  cd sendmail-8.12.6
  cd smrsh/
  patch -p0 < /tmp/20021004SENDMAIL/smrsh-20020924.patch 
  cd ..

  cp /tmp/20021004SENDMAIL/sendmail.mc cf/cf
  cp /tmp/20021004SENDMAIL/popauth.m4 cf/hack

  #RH 7.X Change -- This fixes some non standard paths that Redhat uses
  yes y | cp /tmp/20021004SENDMAIL/Linux-OS devtools/OS/Linux

  #Add an SMMSP User Sendmail 8.12.X Change
  /usr/sbin/adduser -M -u 102 -s /bin/false smmsp

  sh Build
  sh Build install

  cd cf/cf
  sh Build sendmail.cf

#Install the Configuration files / Make dirs / etc.
  sh Build install-cf
  mkdir /var/spool/mqueue
  chmod 755 /etc/mail /var/spool/mqueue
  chown root.mail /var/spool/mqueue

  cp sendmail.mc /etc/mail/

  #NOTE: Poprelayd-KAM requires DB_File which is an ext module of perl and may need to be manually installed.  
  #    i.e. 'cd /usr/src/perl-5.6.1/ext/DB_Files/; perl Makefile.PL; make; make install; cd /etc/mail'
        
  makemap hash /etc/mail/popauth.db < /dev/null

  cp /tmp/20021004SENDMAIL/poprelayd-KAM.pl /usr/local/sbin/
  chmod +x /usr/local/sbin/poprelayd-KAM.pl
  ###Add Poprelay Daemon to /etc/rc.d/rc.local (i.e. add a line that says this /usr/local/sbin/poprelayd-KAM.pl -d)
        
  ###run Poprelay delay
  /usr/local/sbin/poprelayd-KAM.pl -d

#Restore Saved files and Move files to proper locations
  cd /tmp/20021004SENDMAIL/
  tar zxvf sendmail-save.tar.gz
  mv /tmp/20021004SENDMAIL/etc/rc.d/init.d/sendmail /etc/rc.d/init.d
  cd /etc/rc3.d; ln -s ../init.d/sendmail S80sendmail
  cd /etc/rc0.d; ln -s ../init.d/sendmail K30sendmail
  mv /tmp/20021004SENDMAIL/etc/aliases /etc/mail/
  mv /tmp/20021004SENDMAIL/etc/pam.d/smtp /etc/pam.d/
  mv /tmp/20021004SENDMAIL/etc/sysconfig/sendmail /etc/sysconfig/
  mv /tmp/20021004SENDMAIL/etc/mail/access /etc/mail
  mv /tmp/20021004SENDMAIL/etc/mail/domaintable /etc/mail
  mv /tmp/20021004SENDMAIL/etc/mail/local-host-names /etc/mail
  mv /tmp/20021004SENDMAIL/etc/mail/mailertable /etc/mail
  mv /tmp/20021004SENDMAIL/etc/mail/Makefile /etc/mail
  mv /tmp/20021004SENDMAIL/etc/mail/trusted-users /etc/mail
  mv /tmp/20021004SENDMAIL/etc/mail/virtusertable /etc/mail
  mv /tmp/20021004SENDMAIL/usr/lib/sasl/Sendmail.conf /usr/lib/sasl/

  #Recreate db files
  /usr/bin/newaliases
  cd /etc/mail
  make all

#Create smrsh dir and link procmail and vacation
  mkdir /usr/adm; mkdir /usr/adm/sm.bin; cd /usr/adm/sm.bin
  #OPTIONAL -- The Current Patch MAY close the procmail security whole smrsh but may not: ln -s /usr/bin/procmail procmail
  ln -s /usr/bin/vacation vacation

#START HER UP!
  /etc/rc.d/init.d/sendmail start

#GET RID OF THE TEMP DIR FOR THE TAR FILES (OPTIONAL)
#rm -rf /tmp/20021004SENDMAIL/
