aboutsummaryrefslogtreecommitdiff
path: root/mail/qmail/files
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/qmail/files
parente1ef09b7cfe3bae67373f419a3a33c0dcc190376 (diff)
downloadports-c5f3f70024b2636bdb07bdabc85d5c30115bf668.tar.gz
ports-c5f3f70024b2636bdb07bdabc85d5c30115bf668.zip
Notes
Diffstat (limited to 'mail/qmail/files')
-rw-r--r--mail/qmail/files/rcNG83
1 files changed, 83 insertions, 0 deletions
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"