spamassassin/rc.spamassassin

Mon, 28 Jan 2013 17:37:18 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 28 Jan 2013 17:37:18 +0100
changeset 758
a2c6460cfb16
parent 191
d980506f80fc
permissions
-rw-r--r--

Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.

     1 #!@l_prefix@/bin/openpkg rc
     2 ##
     3 ##  rc.spamassassin -- Run-Commands
     4 ##
     6 %config
     7     spamassassin_enable="$openpkg_rc_def"
     8     spamassassin_bind="127.0.0.1"
     9     spamassassin_port="783"
    10     spamassassin_flags="-x -u @l_rusr@ -A 127. --local --virtual-config-dir=@l_prefix@/var/spamassassin/spool/%u"
    11     spamassassin_stop_delay="2"
    12     spamassassin_log_prolog="true"
    13     spamassassin_log_epilog="true"
    14     spamassassin_log_numfiles="10"
    15     spamassassin_log_minsize="1M"
    16     spamassassin_log_complevel="9"
    18 %common
    19     spamassassin_etcdir="@l_prefix@/etc/spamassassin"
    20     spamassassin_pidfile="@l_prefix@/var/spamassassin/spamassassin.pid"
    21     spamassassin_logfile="@l_prefix@/var/spamassassin/spamassassin.log"
    22     spamassassin_signal () {
    23         [ -f $spamassassin_pidfile ] && kill -$1 `cat $spamassassin_pidfile`
    24     }
    26 %status -u @l_susr@ -o
    27     spamassassin_usable="unknown"
    28     spamassassin_active="no"
    29     rcService spamassassin enable yes && \
    30         spamassassin_signal 0 && spamassassin_active="yes"
    31     echo "spamassassin_enable=\"$spamassassin_enable\""
    32     echo "spamassassin_usable=\"$spamassassin_usable\""
    33     echo "spamassassin_active=\"$spamassassin_active\""
    35 %start -p 400 -u @l_susr@
    36     rcService spamassassin enable yes || exit 0
    37     rcService spamassassin active yes && exit 0
    38     @l_prefix@/bin/spamd \
    39         --daemonize \
    40         --siteconfigpath="${spamassassin_etcdir}" \
    41         --pidfile="${spamassassin_pidfile}" \
    42         --syslog="${spamassassin_logfile}" \
    43         --listen-ip="${spamassassin_bind}" \
    44         --port="${spamassassin_port}" \
    45         ${spamassassin_flags}
    47 %stop -p 400 -u @l_susr@
    48     rcService spamassassin enable yes || exit 0
    49     rcService spamassassin active no && exit 0
    50     spamassassin_signal TERM
    51     sleep "$spamassassin_stop_delay"
    53 %restart -p 600 -u @l_susr@
    54     rcService spamassassin enable yes || exit 0
    55     rcService spamassassin active no && exit 0
    56     rc spamassassin stop
    57     rc spamassassin start
    59 %daily -u @l_susr@
    60     rcService spamassassin enable yes || exit 0
    61     shtool rotate -f \
    62         -n ${spamassassin_log_numfiles} -s ${spamassassin_log_minsize} -d \
    63         -z ${spamassassin_log_complevel} -o @l_rusr@ -g @l_rgrp@ -m 644 \
    64         -P "${spamassassin_log_prolog}" \
    65         -E "${spamassassin_log_epilog}; rc spamassassin restart" \
    66         $spamassassin_logfile

mercurial