Highly Available HP-UX Internet Services (May 2008)
/usr/sbin/sendmail -L sm-mta -bd -q30m && echo "Starting sendmail [Done]"
set_return
if [ $rval -eq 0 ]; then
if [ -f /etc/mail/submit.cf ]; then
/usr/sbin/sendmail -L sm-msp-queue -Ac -q30m && echo "Starting
sm-client [Done]"
set_return
if [ $rval -ne 0 ]; then
echo "Unable to start sm-client"
echo "Unable to start sendmail client"| $LOGGER
[ -f "$pidfile_msp" ] && rm -f "$pidfile_msp" >/dev/null
rval=1
fi
else
echo "Unable to start sm-client"
echo "/etc/mail/submit.cf is missing" | $LOGGER
echo "Sendmail client not started" | $LOGGER
echo "\nFor more information see $LOG_FILE"
fi
else
echo "Unable to start Sendmail"
echo "Unable to start Sendmail "| $LOGGER
if [ -f "$pidfile_mta" ] && rm -f "$pidfile_mta" >/dev/null
rval=1
fi
else
echo "Unable to start Sendmail"
echo "/etc/mail/sendmail.cf file missing" | $LOGGER
echo "Unable to start Sendmail "| $LOGGER
rval=1
fi
fi
elif [ "X$SENDMAIL_SERVER_NAME" != "X" ] ; then
#
# This host is a sendmail client and will not run a sendmail daemon.
# The sendmail configuration file will be checked to see if
# the DH and DM macros are properly defined to SENDMAIL_SERVER_NAME
# and if they are not, the .cf file will be rewritten to do so.
# If they are already defined, leave them alone.
#
if [ -f /etc/mail/sendmail.cf ]; then
mv /etc/mail/sendmail.cf /etc/mail/#sendmail.cf
sed -e s/^DH$/DH$SENDMAIL_SERVER_NAME.\$m/ \
-e s/^DM$/DM$SENDMAIL_SERVER_NAME.\$m/ \
/etc/mail/#sendmail.cf \
> /etc/mail/sendmail.cf
echo $SENDMAIL_SERVER_NAME
rm /etc/mail/#sendmail.cf
set_return
else
echo "/etc/mail/sendmail.cf file missing"
exit 1
fi
elif [ $RECV_ONLY -eq 1 ] ; then
if grep "^Scheck_compat" /etc/mail/sendmail.cf > /dev/null 2>/dev/null
then
check_pid_file
# Make a note with syslogd that the sendmail daemon is being started
echo "#### Starting sendmail ####" | $LOGGER
if [ -f /etc/mail/sendmail.cf ]; then
create_cw
newaliases | $LOGGER
/usr/sbin/sendmail -L sm-mta -bd -q30m && echo "Starting sendmail : receive only [Done]"
set_return
if [ $rval -ne 0 ];
then
echo "Unable to start Sendmail : receive only"
echo "Unable to start Sendmail : receive only" | $LOGGER
[ -f "$pidfile_mta" ] && rm -f "$pidfile_mta" >/dev/null
rval=1
fi
else
echo "Unable to start Sendmail"
echo "/etc/mail/sendmail.cf file missing" | $LOGGER
26