Hello all,

I am trying to setup postfix so that it will start automatically at startup. I placed the following script "postfix" in a text file "postfix" and saved it to Library/Startupitems/Postfix. As you probably guessed it did not work. I would be grateful for some detailed instructions on how I can get postfix to start automatically.

Thanks in advance for any help
rups

Script:
#       !/sbin/sh
#       Starts, stops and reloads Postfix at system startup
#       Logger and Postfix path
#
LOGGER="/usr/bin/logger"
POSTFIX="/usr/sbin/postfix"
rc=0

if [ ! -f $POSTFIX ] ; then
        $LOGGER -t $0 -s -p mail.err "Unable to locate Postfix"
        exit(1)
fi
if [ ! -f /etc/postfix/main.cf ] ; then
        $LOGGER -t $0 -d -p mail.err "Unable to locate Postfix configuration"
        exit(1)
fi
        
case "$1" in
        start)
                echo -n "Starting Postfix"
                $POSTFIX start
                rc=$?
                echo "."
                ;;
                
        stop)
                echo -n "Stopping Postfix"
                $POSTFIX stop
                rc=&?
                echo "."
                ;;
        
        restart)
                echo -n "Restarting Postfix"
                $POSTFIX reload
                rc=&?
                echo "."
                ;;

        *)      echo "Usage: $0 {start|stop|restart}"
                rc=1
                
esac
exit $rc

Reply via email to