ports/117422: [PATCH] startup file for qmail-smtpd

Nick at van-laarhoven.org Nick at van-laarhoven.org
Tue Oct 23 11:40:03 UTC 2007

>Number:         117422
>Category:       ports
>Synopsis:       [PATCH] startup file for qmail-smtpd
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 23 11:40:02 UTC 2007
>Originator:     Nick Hibma
>Release:        FreeBSD 6.2-STABLE i386
AnyWi Technologies
System: FreeBSD uitsmijter.van-laarhoven.org 6.2-STABLE FreeBSD 6.2-STABLE #2: Sat Feb 10 22:04:29 CET 2007 root at uitsmijter.van-laarhoven.org:/usr/src/sys/i386/compile/UITSMIJTER i386

Please find below a complete startup script for qmail-smtpd. I've now written
the thing several times, and it might as well be included in the distribution.
Put it in /usr/local/etc/rc.d and add the appropriate flags in /etc/rc.conf or
# Copyright 2007, AnyWi Technologies
# PROVIDE: qmailsmtpd
# REQUIRE: LOGIN cleanvar
# To use the checkpassword interface to qmail-smtpd, set
# qmailsmtpd_checkpassword to the full path to the checkpassword program (e.g.
# security/checkpassword or security checkpassword-pam).
# Note: tcpserver can be found in the sysutils/ucspi-tcp package.

. /etc/rc.subr


load_rc_config $name

: ${qmailsmtpd_tcpserver="/usr/local/bin/tcpserver"}
: ${qmailsmtpd_tcprules="/usr/local/bin/tcprules"}
: ${qmailsmtpd_enable="NO"}
: ${qmailsmtpd_cdb="/etc/tcp.smtp"}
: ${qmailsmtpd_flags="-R -H -u 82 -g 81"}
: ${qmailsmtpd_host="0"}
: ${qmailsmtpd_port="smtp"}
: ${qmailsmtpd_smtpd="/var/qmail/bin/qmail-smtpd"}
: ${qmailsmtpd_fqdn=`hostname`}
: ${qmailsmtpd_checkpassword=""}		# e.g. /usr/local/bin/checkpassword-pam
: ${qmailsmtpd_checksubprogram="/usr/bin/true"}

	$qmailsmtpd_tcprules $qmailsmtpd_cdb.cdb $qmailsmtpd_cdb.tmp < $qmailsmtpd_cdb \
		|| return 1

	if [ "x$qmailsmtpd_checkpassword" != "x" ]; then
		qmailsmtpd_usercheck="$qmailsmtpd_fqdn $qmailsmtpd_checkpassword $qmailsmtpd_checksubprogram"

        echo "Starting qmail-smtpd."
	$qmailsmtpd_tcpserver -x $qmailsmtpd_cdb.cdb $qmailsmtpd_flags $qmailsmtpd_host $qmailsmtpd_port \
		$qmailsmtpd_smtpd $qmailsmtpd_usercheck &

	echo $! > /var/run/qmailsmtpd.pid

        echo "Stopping qmail-smtpd"
        kill `cat /var/run/qmailsmtpd.pid`


run_rc_command "$1"


More information about the freebsd-ports-bugs mailing list