aboutsummaryrefslogtreecommitdiff
path: root/trunk/templates/vserver/files/etc/rc.d/rc.sendmail
blob: 1a31c52529fb457cdaf7b29512f97bb7e11adb09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
# Start/stop/restart sendmail.

# Start sendmail:
sendmail_start() {
  if [ -x /usr/sbin/sendmail ]; then
    echo "Starting sendmail MTA daemon: /usr/sbin/sendmail -L sm-mta -bd -q25m"
    /usr/sbin/sendmail -L sm-mta -bd -q25m
    echo "Starting sendmail MSP queue runner: /usr/sbin/sendmail -L sm-msp-queue -Ac -q25m"
    /usr/sbin/sendmail -L sm-msp-queue -Ac -q25m
  fi
}

# Stop sendmail:
sendmail_stop() {
  killall sendmail
}

# Restart sendmail:
sendmail_restart() {
  sendmail_stop
  sleep 1
  sendmail_start
}

case "$1" in
'start')
  sendmail_start
  ;;
'stop')
  sendmail_stop
  ;;
'restart')
  sendmail_restart
  ;;
*)
  echo "usage $0 start|stop|restart"
esac