aboutsummaryrefslogtreecommitdiff
path: root/mail/rbl-milter
diff options
context:
space:
mode:
authorDirk Meyer <dinoex@FreeBSD.org>2009-03-28 15:32:57 +0000
committerDirk Meyer <dinoex@FreeBSD.org>2009-03-28 15:32:57 +0000
commit6eed0c050efac2b9f66f48f664e7db380293247d (patch)
tree386e2d00b269077ec26fd695ac2dd32c83a0322f /mail/rbl-milter
parent8345e0da713fde9999d474904f5b4eaf8da3b317 (diff)
downloadports-6eed0c050efac2b9f66f48f664e7db380293247d.tar.gz
ports-6eed0c050efac2b9f66f48f664e7db380293247d.zip
Notes
Diffstat (limited to 'mail/rbl-milter')
-rw-r--r--mail/rbl-milter/Makefile8
-rw-r--r--mail/rbl-milter/files/rbl-milter.sh.in28
-rw-r--r--mail/rbl-milter/files/rblmilter.sh.in48
-rw-r--r--mail/rbl-milter/pkg-message10
4 files changed, 57 insertions, 37 deletions
diff --git a/mail/rbl-milter/Makefile b/mail/rbl-milter/Makefile
index 82c620939638..04386efbb9da 100644
--- a/mail/rbl-milter/Makefile
+++ b/mail/rbl-milter/Makefile
@@ -7,20 +7,20 @@
PORTNAME= rbl-milter
PORTVERSION= 0.30
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= mail
MASTER_SITES= http://opensource.confusticate.com/rbl-milter/
MAINTAINER= dinoex@FreeBSD.org
COMMENT= A milter that adds mail header warnings on mail from open-relays
-SUB_FILES= rbl-milter.sh
+USE_RC_SUBR= rblmilter.sh
GNU_CONFIGURE= yes
USE_GMAKE= yes
CONFIGURE_ENV+= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" PTHREAD_LIBS="${PTHREAD_LIBS}"
-PLIST_FILES= sbin/rbl-milter etc/rc.d/rbl-milter.sh
+PLIST_FILES= sbin/rbl-milter
.if defined(NO_WERROR)
pre-configure:
@@ -29,8 +29,6 @@ pre-configure:
.endif
post-install:
- ${INSTALL_SCRIPT} ${WRKDIR}/rbl-milter.sh \
- ${PREFIX}/etc/rc.d/rbl-milter.sh
@${CAT} ${PKGMESSAGE}
.include <bsd.port.pre.mk>
diff --git a/mail/rbl-milter/files/rbl-milter.sh.in b/mail/rbl-milter/files/rbl-milter.sh.in
deleted file mode 100644
index 2f540d3c7f5c..000000000000
--- a/mail/rbl-milter/files/rbl-milter.sh.in
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-if [ ! -f %%PREFIX%%/sbin/rbl-milter ]
-then
- echo "rbl-milter not installed"
- exit 0;
-fi
-
-case $1 in
-start)
- %%PREFIX%%/sbin/rbl-milter -l -r -p local:/var/run/rbl-milter -d relays.ordb.org \
- && echo -n " rbl-milter" \
- || echo " rbl-milter FAILED TO START"
- ;;
-stop)
- killall rbl-milter && echo -n " rbl-milter"
- ;;
-restart)
- $0 stop
- $0 start
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- exit 64
- ;;
-esac
-
-exit 0
diff --git a/mail/rbl-milter/files/rblmilter.sh.in b/mail/rbl-milter/files/rblmilter.sh.in
new file mode 100644
index 000000000000..f09d159393b8
--- /dev/null
+++ b/mail/rbl-milter/files/rblmilter.sh.in
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+# $FreeBSD$
+
+# Start or stop rblmilter
+
+# PROVIDE: rblmilter
+# REQUIRE: DAEMON
+# BEFORE: mail
+# KEYWORD: shutdown
+#
+
+prefix=%%PREFIX%%
+
+# Define these rblmilter_* variables in one of these files:
+# /etc/rc.conf
+# /etc/rc.conf.local
+# /etc/rc.conf.d/rblmilter
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+rblmilter_enable=${rblmilter_enable:-"NO"} # Enable rblmilter
+rblmilter_socket=${rblmilter_socket:-"/var/run/rbl-milter"} # Path to socket
+rblmilter_flags=${rblmilter_flags:-"-l -r -d relays.ordb.org"} # Flags to rblmilter
+
+. /etc/rc.subr
+
+name="rblmilter"
+rcvar=`set_rcvar`
+command="${prefix}/sbin/rbl-milter"
+start_precmd="rblmilter_prestart"
+stop_postcmd="rblmilter_poststop"
+extra_commands="reload"
+
+rblmilter_prestart() {
+ /bin/rm -f "${rblmilter_socket}"
+}
+
+rblmilter_poststop() {
+ /bin/rm -f "${rblmilter_socket}"
+}
+
+load_rc_config $name
+command_args="-p local:${rblmilter_socket} ${rblmilter_flags}"
+
+run_rc_command "$1"
+
+# eof
diff --git a/mail/rbl-milter/pkg-message b/mail/rbl-milter/pkg-message
index f67f1d534155..f2235d4a3c73 100644
--- a/mail/rbl-milter/pkg-message
+++ b/mail/rbl-milter/pkg-message
@@ -1,8 +1,10 @@
-The start/stop script has been placed in $PREFIX/etc/rc.d/rbl-milter.sh
-Run the program now with the start command to get rbl-milter running.
+Add to your /etc/rc.conf
+rblmilter_enable="YES"
+Then run the milter with: $PREFIX/etc/rc.d/rbl-milter start
+
By default, it uses the relays found at relays.ordb.org but you can
-change that by modifying the script. It accepts multiple -d commands
-for multiple site checks.
+change that by setting rblmilter_flags in /etc/rc.conf:
+rblmilter_flags="-l -r -d relays.ordb.org"
Note that you will need to edit the proper sendmail.mc file in your
/etc/mail directory so that sendmail will pass mail to rbl-milter.