1#!/bin/sh
2
3. /etc/rc.common
4
5StartService ()
6{
7    if [ "${MAILSERVER:=-NO-}" = "-YES-" ]; then
8            ConsoleMessage "Starting mail services"
9	    /usr/sbin/postfix start
10    elif [ "${MAILSERVER:=-NO-}" = "-AUTOMATIC-" ]; then
11	    /usr/sbin/postfix-watch
12    fi
13}
14
15StopService ()
16{
17	ConsoleMessage "Stopping Postfix mail services"
18	/usr/sbin/postfix stop
19	killall -1 postfix-watch 2> /dev/null
20}
21
22RestartService ()
23{
24    if [ "${MAILSERVER:=-NO-}" = "-YES-" ]; then
25	ConsoleMessage "Reloading Postfix configuration"
26	/usr/sbin/postfix reload
27    else
28	StopService
29    fi
30}
31
32RunService "$1"
33