MAIL_MAKE=0

if [ ! -f /etc/mail/local-host-names ] ; then
  touch /etc/mail/local-host-names
  MAIL_MAKE=1
fi  &&
if [ ! -f /etc/mail/aliases ] ; then
  touch /etc/mail/aliases
  MAIL_MAKE=1
fi  &&
if [ ! -f /etc/mail/sendmail.mc ] ; then
  install -m 0640 -g mail -o root $SOURCE_DIRECTORY/cf/cf/sendmail.mc /etc/mail/
  ( cd /etc/mail && make sendmail.cf )
  MAIL_MAKE=1
fi  &&
if [ ! -f /etc/mail/submit.mc ] ; then
  install -m 0640 -g mail -o root $SOURCE_DIRECTORY/cf/cf/submit.mc /etc/mail/
  ( cd /etc/mail && make submit.cf )
  MAIL_MAKE=1
fi  &&

# Prevent nuking a CURRENT installation of sendmail ... grumble grumble
#
if [ "$MAIL_MAKE" == "1" ] ; then
  ( cd /etc/mail && make all )
fi
