aboutsummaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2007-07-28 13:50:18 +0000
committerRenato Botelho <garga@FreeBSD.org>2007-07-28 13:50:18 +0000
commitc5f3f70024b2636bdb07bdabc85d5c30115bf668 (patch)
treeea3b1d159951ea4819e1f39b3fcd25637cc205fc /mail
parente1ef09b7cfe3bae67373f419a3a33c0dcc190376 (diff)
downloadports-c5f3f70024b2636bdb07bdabc85d5c30115bf668.tar.gz
ports-c5f3f70024b2636bdb07bdabc85d5c30115bf668.zip
Notes
Diffstat (limited to 'mail')
-rw-r--r--mail/qmail/Makefile3
-rw-r--r--mail/qmail/files/rcNG83
-rw-r--r--mail/qmail/pkg-plist1
3 files changed, 87 insertions, 0 deletions
diff --git a/mail/qmail/Makefile b/mail/qmail/Makefile
index 5ddd111a3159..c3a58e3fcbc5 100644
--- a/mail/qmail/Makefile
+++ b/mail/qmail/Makefile
@@ -679,6 +679,9 @@ do-install:
.for i in ${BOOTFILES}
${INSTALL_SCRIPT} ${WRKDIR}/${i:T} ${PREFIX}/boot
.endfor
+. if !defined(SLAVE_LDAP)
+ ${INSTALL_SCRIPT} ${FILESDIR}/rcNG ${PREFIX}/boot
+.endif
.for i in 1 5 7 8
@${MKDIR} ${PREFIX}/man/man$i
. for j in ${MAN${i}}
diff --git a/mail/qmail/files/rcNG b/mail/qmail/files/rcNG
new file mode 100644
index 000000000000..c60a3325b945
--- /dev/null
+++ b/mail/qmail/files/rcNG
@@ -0,0 +1,83 @@
+#!/bin/sh
+
+# PROVIDE: qmail mail
+# REQUIRE: netif
+# BEFORE: LOGIN
+#
+#writen by Zane C. Bowers <vvelox@vvelox.net>
+
+. /etc/rc.subr
+
+name="qmail"
+rcvars=`set_rcvar`
+start_cmd="qmail_start"
+stop_cmd="qmail_stop"
+
+load_rc_config $name
+
+
+#
+# Add the following lines to /etc/rc.conf to enable qmail:
+# qmail_enable (bool): Turn on QMail.
+# Default: NO
+#
+# qmail_checkpw (str): Tell QMail what chekpassword program to use.
+# Default: /usr/local/bin/checkpassword
+#
+# qmail_checkpwsuccess (str): Tell the server what to run if checkpassword works.
+# Default: /bin/true
+#
+# qmail_server (bool): Wether the SMTP server should be started.
+# Default: YES
+#
+# qmail_server_ip (str): The IP to listen on. 0 means all.
+# Default: 0
+#
+# qmail_server_port (str): The port to listen on. May be numeric or from /etc/services
+# Default: smtp
+#
+# qmail_tcpserver_args (str): Extra args to be passed to tcpserver.
+#
+# qmail_defaultdelivery (str): Default delivery path.
+# Default: ./Maildir
+# qmail_logger (str): The logger to use.
+# Default: splogger qmail
+# qmail_server_logger (str): The logger to use for the SMTP server.
+# Default: /var/qmail/bin/splogger smtpd
+
+[ -z "$qmail_enable" ] && qmail_enable="NO"
+[ -z "$qmail_checkpw" ] && qmail_checkpw="/usr/local/bin/checkpassword"
+[ -z "$qmail_checkpwsuccess" ] && qmail_checkpw="/bin/true"
+[ -z "$qmail_server" ] && qmail_server="YES"
+[ -z "$qmail_server_ip" ] && qmail_server_ip="0"
+[ -z "$qmail_server_port" ] && qmail_server_port="smtp"
+[ -z "$qmail_defaultdelivery" ] && qmail_defaultdelivery="./Maildir"
+[ -z "$qmail_logger" ] && qmail_defaultdelivery="splogger qmail"
+[ -z "$qmail_server_logger" ] && qmail_server_logger="/var/qmail/bin/splogger smtpd"
+
+qmail_start(){
+ env - PATH="/var/qmail/bin:$PATH" \
+ qmail-start $qmail_defaultdelivery $qmail_server_logger &
+
+ if checkyesno qmail_server; then
+ qmaildUID=`id qmaild | cut -d\ -f 1 | cut -d= -f 2 | cut -d\( -f 1`
+ qnofilesGID=`pw group show qnofiles | cut -d: -f 3`
+
+ env - PATH="/var/qmail/bin:$PATH" /usr/local/bin/tcpserver $qmail_tcpserver_args -u \
+ $qmaildUID -g $qnofilesGID $qmail_server_ip $qmail_server_port \
+ /var/qmail/bin/qmail-smtpd $qmail_checkpw -- /bin/true 2>&1 | $qmail_server_logger &
+ fi
+
+}
+
+qmail_stop(){
+ killall -9 qmail-send > /dev/null
+
+ #tcpserverPID=`ps aux | grep tcpserver | grep ^qmaild | cut -d\ -f 4`
+ tcpserverPID=`ps -aw -o pid,user,command | grep tcpserver | grep qmail-smtpd | sed 's/^ *//' | cut -f 1 -d\ `
+ [ $tcpserverPID ] && kill -9 $tcpserverPID
+ #kill -9 $tcpserverPID
+}
+
+
+run_rc_command "$1"
diff --git a/mail/qmail/pkg-plist b/mail/qmail/pkg-plist
index 62a85bd3d959..1bfbb9920974 100644
--- a/mail/qmail/pkg-plist
+++ b/mail/qmail/pkg-plist
@@ -66,6 +66,7 @@ bin/qsmhook
bin/sendmail
bin/splogger
bin/tcp-env
+%%NOT_LDAP%%boot/rcNG
%%NOT_LDAP%%boot/binm1
%%NOT_LDAP%%boot/binm1+df
%%NOT_LDAP%%boot/binm2