summaryrefslogtreecommitdiff
path: root/mail/tmda
diff options
context:
space:
mode:
authorschmonz <schmonz@pkgsrc.org>2007-02-27 00:18:46 +0000
committerschmonz <schmonz@pkgsrc.org>2007-02-27 00:18:46 +0000
commit632c31c14dadf8f82ec7322d465a3c670b1b2bbd (patch)
treef91dc46010bec010e38d5be3cf2294173559c982 /mail/tmda
parent5eb91d7438e6bc7cf8b9eb181e3ef3be2f30d86d (diff)
downloadpkgsrc-632c31c14dadf8f82ec7322d465a3c670b1b2bbd.tar.gz
Improve interface to tofmipd rc.d script, akin to that of qmail-run.
Now one sets the host and port in rc.conf with tofmipd_tcp{host,port} (default "localhost:8025") and manages logging with tofmipd_log (default: "YES", to syslog) and friends. tofmipd_flags is still useful for authentication and miscellaneous other options. Bump PKGREVISION.
Diffstat (limited to 'mail/tmda')
-rw-r--r--mail/tmda/Makefile3
-rwxr-xr-xmail/tmda/files/tofmipd.sh24
2 files changed, 22 insertions, 5 deletions
diff --git a/mail/tmda/Makefile b/mail/tmda/Makefile
index 40c435aa143..72c8e54c4d7 100644
--- a/mail/tmda/Makefile
+++ b/mail/tmda/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.37 2007/02/26 03:48:53 schmonz Exp $
+# $NetBSD: Makefile,v 1.38 2007/02/27 00:18:46 schmonz Exp $
#
DISTNAME= tmda-1.1.11
+PKGREVISION= 1
CATEGORIES= mail python
MASTER_SITES= http://tmda.sourceforge.net/ftp/releases/
MASTER_SITES+= ftp://tmda.net/pub/tmda/releases/
diff --git a/mail/tmda/files/tofmipd.sh b/mail/tmda/files/tofmipd.sh
index e39d900e302..e3466a39bac 100755
--- a/mail/tmda/files/tofmipd.sh
+++ b/mail/tmda/files/tofmipd.sh
@@ -1,18 +1,34 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: tofmipd.sh,v 1.2 2004/06/10 16:33:40 schmonz Exp $
+# $NetBSD: tofmipd.sh,v 1.3 2007/02/27 00:18:46 schmonz Exp $
#
# PROVIDE: mail
# REQUIRE: LOGIN
+name="tofmipd"
+
+# User-settable rc.conf variables and their default values:
+: ${tofmipd_tcphost:="localhost"}
+: ${tofmipd_tcpport:="8025"}
+: ${tofmipd_log:="YES"}
+: ${tofmipd_logcmd:="logger -t nb${name} -p mail.info"}
+: ${tofmipd_nologcmd:="@CAT@ >/dev/null"}
+
. /etc/rc.subr
-name="tofmipd"
-rcvar=$name
+rcvar=${name}
command="@PREFIX@/bin/tmda-ofmipd"
-command_args="-b"
command_interpreter="@PYTHONBIN@"
+start_precmd="tofmipd_precmd"
+
+tofmipd_precmd()
+{
+ checkyesno tofmipd_log || tofmipd_logcmd=${tofmipd_nologcmd}
+ command="@SETENV@ - ${command} ${tofmipd_flags} -p ${tofmipd_tcphost}:${tofmipd_tcpport} -f -L 2>&1 | @SU@ -m tofmipd -c '${tofmipd_logcmd}'"
+ command_args="&"
+ rc_flags=""
+}
load_rc_config $name
run_rc_command "$1"