summaryrefslogtreecommitdiff
path: root/security/clamav/files/clamav-milter.in
diff options
context:
space:
mode:
Diffstat (limited to 'security/clamav/files/clamav-milter.in')
-rw-r--r--security/clamav/files/clamav-milter.in46
1 files changed, 46 insertions, 0 deletions
diff --git a/security/clamav/files/clamav-milter.in b/security/clamav/files/clamav-milter.in
new file mode 100644
index 000000000000..2176d9a35989
--- /dev/null
+++ b/security/clamav/files/clamav-milter.in
@@ -0,0 +1,46 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: clamav-milter
+# REQUIRE: LOGIN clamd
+# BEFORE: mail
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable clamav-milter:
+#
+#clamav_milter_enable="YES"
+#
+# See clamav-milter(1) for flags
+#
+
+. %%RC_SUBR%%
+
+name=clamav_milter
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/sbin/clamav-milter
+pidfile=%%RUNDIR%%/clamav-milter.pid
+required_dirs=%%DBDIR%%
+required_files=%%PREFIX%%/etc/clamd.conf
+
+start_precmd=start_precmd
+
+start_precmd()
+{
+ if [ -S "$clamav_milter_socket" ]; then
+ warn "Stale socket $clamav_milter_socket removed."
+ rm "$clamav_milter_socket"
+ fi
+ rc_flags="--pidfile ${pidfile} ${flags:-$clamav_milter_flags} $clamav_milter_socket"
+}
+
+# read settings, set default values
+load_rc_config $name
+: ${clamav_milter_enable="NO"}
+: ${clamav_milter_socket="%%CLAMAV_MILTER_SOCKET%%"}
+: ${clamav_milter_flags="--postmaster-only --local --outgoing --timeout=0 --max-children=50"}
+
+run_rc_command "$1"