aboutsummaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
Diffstat (limited to 'security')
-rw-r--r--security/amavisd-new/Makefile2
-rw-r--r--security/amavisd-new/files/amavis-milter.in19
-rw-r--r--security/amavisd-new/files/amavis-p0fanalyzer.in29
-rw-r--r--security/amavisd-new/files/amavisd-snmp.in20
-rw-r--r--security/amavisd-new/files/amavisd.in59
5 files changed, 57 insertions, 72 deletions
diff --git a/security/amavisd-new/Makefile b/security/amavisd-new/Makefile
index e830a28153e2..ef0cf941d432 100644
--- a/security/amavisd-new/Makefile
+++ b/security/amavisd-new/Makefile
@@ -2,7 +2,7 @@
PORTNAME= amavisd-new
PORTVERSION= 2.8.0
-PORTREVISION= 1
+PORTREVISION= 2
PORTEPOCH= 1
CATEGORIES= security
MASTER_SITES= http://www.ijs.si/software/amavisd/ \
diff --git a/security/amavisd-new/files/amavis-milter.in b/security/amavisd-new/files/amavis-milter.in
index ec6136b96661..79a1bb8abeed 100644
--- a/security/amavisd-new/files/amavis-milter.in
+++ b/security/amavisd-new/files/amavis-milter.in
@@ -2,16 +2,14 @@
#
# $FreeBSD$
#
-
# PROVIDE: amavis_milter
# REQUIRE: amavisd
# BEFORE: mail
# KEYWORD: shutdown
-
#
# Add the following lines to /etc/rc.conf to enable amavis-milter:
#
-#amavis_milter_enable="YES"
+# amavis_milter_enable="YES"
#
. /etc/rc.subr
@@ -19,14 +17,13 @@
name=amavis_milter
rcvar=amavis_milter_enable
-command=%%PREFIX%%/sbin/amavis-milter
-required_files=%%PREFIX%%/etc/amavisd.conf
+load_rc_config $name
-# set defaults
+: ${amavis_milter_enable:=NO}
+: ${amavis_milter_flags=-D -p %%AMAVISDIR%%/amavis-milter.sock}
+: ${amavis_milter_user=%%AMAVISUSER%%}
-amavis_milter_enable=${amavis_milter_enable:-"NO"}
-amavis_milter_flags=${amavis_milter_flags:-"-D -p %%AMAVISDIR%%/amavis-milter.sock"}
-amavis_milter_user=${amavis_milter_user:-"%%AMAVISUSER%%"}
+command=%%PREFIX%%/sbin/amavis-milter
+required_files=%%PREFIX%%/etc/amavisd.conf
-load_rc_config $name
-run_rc_command "$1"
+run_rc_command $1
diff --git a/security/amavisd-new/files/amavis-p0fanalyzer.in b/security/amavisd-new/files/amavis-p0fanalyzer.in
index 19e19cee95f6..1f6844730e03 100644
--- a/security/amavisd-new/files/amavis-p0fanalyzer.in
+++ b/security/amavisd-new/files/amavis-p0fanalyzer.in
@@ -1,25 +1,28 @@
#!/bin/sh
# $FreeBSD$
-
+#
# PROVIDE: amavis_p0fanalyzer
# REQUIRE: DAEMON
-# BEFORE: amavisd
-
-amavis_p0fanalyzer_enable="${amavis_p0fanalyzer_enable-NO}"
-amavis_p0fanalyzer_p0f_filter="${amavis_p0fanalyzer_p0f_filter-"tcp dst port 25"}"
-amavis_p0fanalyzer_pidfile1="${amavis_p0fanalyzer_pidfile1-/var/run/p0fanalyzer1.pid}"
-amavis_p0fanalyzer_pidfile2="${amavis_p0fanalyzer_pidfile2-/var/run/p0fanalyzer2.pid}"
-amavis_p0fanalyzer_flags="${amavis_p0fanalyzer_flags-2345}"
+# KEYWORD: shutdown
. /etc/rc.subr
-name="amavis_p0fanalyzer"
+name=amavis_p0fanalyzer
rcvar=amavis_p0fanalyzer_enable
+load_rc_config $name
+
+: ${amavis_p0fanalyzer_enable:=no}
+: ${amavis_p0fanalyzer_p0f_filter:=tcp dst port 25}
+: ${amavis_p0fanalyzer_pidfile1=/var/run/p0fanalyzer1.pid}
+: ${amavis_p0fanalyzer_pidfile2=/var/run/p0fanalyzer2.pid}
+: ${amavis_p0fanalyzer_flags=2345}
+
start_cmd=p0fanalyzer_start
stop_cmd=p0fanalyzer_stop
-p0fanalyzer_start() {
+p0fanalyzer_start()
+{
echo "Starting p0f-analyzer." && \
%%DAEMON%% ${amavis_p0fanalyzer_pidfile1} \
%%PREFIX%%/bin/p0f "${amavis_p0fanalyzer_p0f_filter}" 2>&1 | \
@@ -27,10 +30,10 @@ p0fanalyzer_start() {
%%PREFIX%%/sbin/p0f-analyzer.pl ${amavis_p0fanalyzer_flags}
}
-p0fanalyzer_stop() {
+p0fanalyzer_stop()
+{
/bin/kill `cat ${amavis_p0fanalyzer_pidfile2}` && rm ${amavis_p0fanalyzer_pidfile2}
/bin/kill `cat ${amavis_p0fanalyzer_pidfile1}` && rm ${amavis_p0fanalyzer_pidfile1}
}
-load_rc_config $name
-run_rc_command "$1"
+run_rc_command $1
diff --git a/security/amavisd-new/files/amavisd-snmp.in b/security/amavisd-new/files/amavisd-snmp.in
index 0f724ae759f3..f82f65e08ac4 100644
--- a/security/amavisd-new/files/amavisd-snmp.in
+++ b/security/amavisd-new/files/amavisd-snmp.in
@@ -2,11 +2,9 @@
#
# $FreeBSD$
#
-
# PROVIDE: amavisd_snmp
# REQUIRE: snmpd
# KEYWORD: shutdown
-
#
# Add the following lines to /etc/rc.conf to enable amavisd-snmp-subagent:
#
@@ -18,19 +16,19 @@
name=amavisd_snmp
rcvar=amavisd_snmp_enable
-command="%%PREFIX%%/sbin/amavisd-snmp-subagent"
-command_interpreter="%%PERL%%"
-pidfile="%%AMAVISDIR%%/amavisd-snmp.pid"
+load_rc_config $name
# defaults
-amavisd_snmp_enable=${amavisd_snmp_enable:-"NO"}
-# amavis database directory
-amavisd_snmp_dbdir=${amavisd_snmp_dbdir:-"%%AMAVISDIR%%/db"}
+: ${amavisd_snmp_enable:=NO}
+: ${amavisd_snmp_dbdir=%%AMAVISDIR%%/db}
# log_level 0..5, default 0
-amavisd_snmp_loglevel=${amavisd_snmp_loglevel:-"0"}
+: ${amavisd_snmp_loglevel=0}
-load_rc_config $name
+command=%%PREFIX%%/sbin/amavisd-snmp-subagent
+command_interpreter=%%PERL%%
+pidfile=${amavisd_pidfile:-%%AMAVISDIR%%/amavisd-snmp.pid}
required_dirs=${amavisd_snmp_dbdir}
amavisd_snmp_flags="-D ${amavisd_snmp_dbdir} -d ${amavisd_snmp_loglevel} -P ${pidfile}"
-run_rc_command "$1"
+
+run_rc_command $1
diff --git a/security/amavisd-new/files/amavisd.in b/security/amavisd-new/files/amavisd.in
index 560cbfbd063c..9b2fef94772e 100644
--- a/security/amavisd-new/files/amavisd.in
+++ b/security/amavisd-new/files/amavisd.in
@@ -2,16 +2,14 @@
#
# $FreeBSD$
#
-
# PROVIDE: amavisd
-# REQUIRE: LOGIN mysql postgresql
+# REQUIRE: LOGIN mysql postgresql amavis_p0fanalyzer
# BEFORE: mail
# KEYWORD: shutdown
-
#
# Add the following lines to /etc/rc.conf to enable amavisd:
#
-#amavisd_enable="YES"
+# amavisd_enable="YES"
#
. /etc/rc.subr
@@ -19,47 +17,36 @@
name=amavisd
rcvar=amavisd_enable
+load_rc_config $name
+
+: ${amavisd_enable:=NO}
+pidfile=${amavisd_pidfile-"%%AMAVISDIR%%/amavisd.pid"}
+
command=%%PREFIX%%/sbin/amavisd
command_args='> /dev/null 2>&1'
required_files=%%PREFIX%%/etc/amavisd.conf
-extra_commands="reload"
+extra_commands=reload
start_precmd=start_precmd
+stop_postcmd="rm -f $pidfile"
+reload_cmd="$command reload"
+
# possible values include: amavisd_ram="512m"
# adds ram disk for amavisd defanging/decoding, speeds up large systems 10%
start_precmd()
{
-rm -rf %%AMAVISDIR%%/tmp/* %%AMAVISDIR%%/tmp/.* 2>/dev/null || true
-if [ ${amavisd_ram} ];then
- echo "========================================================"
- echo "WARNING: using ramdisk is reported to be unstable and"
- echo "thus it is highly recommended to be turned off."
- echo "========================================================"
- df %%AMAVISDIR%%/tmp | grep -E '^(/dev/md|tmpfs)' > /dev/null
- if [ $? -eq 1 ]; then
- mdmfs -s ${amavisd_ram} -p 750 -w %%AMAVISUSER%%:%%AMAVISGROUP%% md %%AMAVISDIR%%/tmp || true
- fi
-fi
-}
-stop_postcmd=stop_postcmd
-
-stop_postcmd()
-{
- rm -f $pidfile
-}
-
-reload_cmd=${name}_reload
-
-amavisd_reload()
-{
- ${command} reload
+ rm -rf %%AMAVISDIR%%/tmp/* %%AMAVISDIR%%/tmp/.* 2>/dev/null || true
+ if [ ${amavisd_ram} ];then
+ echo "========================================================"
+ echo "WARNING: using ramdisk is reported to be unstable and"
+ echo "thus it is highly recommended to be turned off."
+ echo "========================================================"
+ df %%AMAVISDIR%%/tmp | grep -E '^(/dev/md|tmpfs)' > /dev/null
+ if [ $? -eq 1 ]; then
+ mdmfs -s ${amavisd_ram} -p 750 -w %%AMAVISUSER%%:%%AMAVISGROUP%% md %%AMAVISDIR%%/tmp || true
+ fi
+ fi
}
-# set defaults
-
-amavisd_enable=${amavisd_enable:-"NO"}
-amavisd_pidfile=${amavisd_pidfile:-"%%AMAVISDIR%%/amavisd.pid"}
-
-load_rc_config $name
-run_rc_command "$1"
+run_rc_command $1