Highly Available HP-UX Internet Services (May 2008)

#
# If none of the variable is set, then the default is to leave
# /usr/sbin/sendmail as executable, and allow mail agents to use
# the default configuration and aliases.
#
if [ -f /etc/mail/sendmail.cf ] ; then
grep "^O DaemonPortOptions" /etc/mail/sendmail.cf | egrep -w "127.0.0.1|::1" >/dev/null
2>&1
if [ $? -eq 0 ] ; then
if [ $MAIL_SERVER -eq 1 -o $RECV_ONLY -eq 1 -o $SEND_ONLY -eq 0 ] ; then
echo "Unable to start Sendmail."
echo "Unable to start Sendmail." | $LOGGER
echo "\nFor more information see $LOG_FILE"
echo "" | $LOGGER
echo "The sendmail.cf file is configured for send_only feature." | $LOGGER
echo "Modify the "/etc/rc.config.d/mailservs" file with the send_only
feature." | $LOGGER
echo "" | $LOGGER
echo "To disable the send_only feature:" | $LOGGER
echo "- Run the gen_cf file to generate the sendmail.cf file." | $LOGGER
echo "- Merge your site-specific customizations with the
/usr/newconfig/etc/mail/cf/cf/sendmail.cf.gen file." | $LOGGER
echo "- Copy the /usr/newconfig/etc/mail/cf/cf/sendmail.cf.gen file as
/etc/mail/sendmail.cf." | $LOGGER
echo "- Change the /etc/rc.config.d/mailservs file accordingly." | $LOGGER
echo "- Restart Sendmail." | $LOGGER
rval=1
exit $rval
fi
else
if [ $SEND_ONLY -eq 1 ] ; then
echo "Unable to start Sendmail."
echo "Unable to start Sendmail." | $LOGGER
echo "\nFor more information see $LOG_FILE"
echo ""
echo "The /etc/mail/sendmail.cf file is not configured for send_only
feature." | $LOGGER
rval=1
exit $rval
fi
fi
fi
if [ $MAIL_SERVER -eq 1 ] ; then
if grep "^Scheck_compat" /etc/mail/sendmail.cf > /dev/null 2>/dev/null
then
echo "Need to run 'gen_cf' manually in /usr/newconfig/etc/mail/cf/cf directory to"
echo "generate sendmail.cf file . You need to merge your site-specific"
echo "customizations with this newly created, /usr/newconfig/etc/mail/cf/cf/sendmail.cf.gen"
echo "file and can be copied as /etc/mail/sendmail.cf. Then start sendmail."
echo ""
else
check_pid_file
#
# This host will run a sendmail daemon and will be either
# a sendmail server for other hosts or it will be a standalone
# sendmail host.
#
# Make a note with syslogd that the sendmail daemon is being started
#
echo "#### Starting sendmail ####" | $LOGGER
#
# Start the sendmail daemon for both a standalone or server sendmail
# situation.
#
if [ -f /etc/mail/sendmail.cf ]; then
create_cw
newaliases | $LOGGER
Appendix B: Sample Scripts for Sendmail 25