From 1472f9ab0cd9d891d502d29d73e63fff99c31bfe Mon Sep 17 00:00:00 2001 From: bdrewery Date: Sat, 23 Feb 2013 18:49:29 +0000 Subject: - Cleanup example rc file - Support SHUTDOWN - Check for needed files/dependencies in precmd - Respect LOCALBASE - Make rclint happy - Rename symlink from qmail.sh to qmailsmtpd - Rename installed example rc file from qmail-smtpd.rcNG to qmailsmtpd --- mail/qmail-mysql/Makefile | 2 +- mail/qmail-spamcontrol/Makefile | 2 +- mail/qmail-tls/Makefile | 2 +- mail/qmail/Makefile | 10 ++++-- mail/qmail/files/pkg-install.in | 4 +-- mail/qmail/files/qmail-smtpd.rcNG | 55 ------------------------------- mail/qmail/files/qmailsmtpd.in | 68 +++++++++++++++++++++++++++++++++++++++ mail/qmail/pkg-plist | 4 +-- 8 files changed, 82 insertions(+), 65 deletions(-) delete mode 100644 mail/qmail/files/qmail-smtpd.rcNG create mode 100644 mail/qmail/files/qmailsmtpd.in (limited to 'mail') diff --git a/mail/qmail-mysql/Makefile b/mail/qmail-mysql/Makefile index cb48c61a92aa..a21a9ec85eaa 100644 --- a/mail/qmail-mysql/Makefile +++ b/mail/qmail-mysql/Makefile @@ -3,7 +3,7 @@ PORTNAME= qmail PORTVERSION= ${QMAIL_VERSION}.${MYSQL_PATCH_VERSION} -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= mail PKGNAMESUFFIX= -mysql diff --git a/mail/qmail-spamcontrol/Makefile b/mail/qmail-spamcontrol/Makefile index 90c36be5b497..e527aceccd93 100644 --- a/mail/qmail-spamcontrol/Makefile +++ b/mail/qmail-spamcontrol/Makefile @@ -2,7 +2,7 @@ PORTNAME= qmail PORTVERSION= ${QMAIL_VERSION}.${SPAMCONTROL_VERSION} -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= mail MASTER_SITES+= http://www.fehcom.de/qmail/spamcontrol/:spamcontrol \ ${MASTER_SITE_LOCAL:S/$/:spamcontrol/} diff --git a/mail/qmail-tls/Makefile b/mail/qmail-tls/Makefile index 2b389588317f..9c561a2a4fe2 100644 --- a/mail/qmail-tls/Makefile +++ b/mail/qmail-tls/Makefile @@ -3,7 +3,7 @@ PORTNAME= qmail PORTVERSION= ${QMAIL_VERSION}.${TLS_PATCH_DATE} -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= mail PKGNAMESUFFIX= -tls diff --git a/mail/qmail/Makefile b/mail/qmail/Makefile index 8e124fb0de05..fa2efb84b9df 100644 --- a/mail/qmail/Makefile +++ b/mail/qmail/Makefile @@ -3,7 +3,7 @@ PORTNAME= qmail PORTVERSION?= ${QMAIL_VERSION} -PORTREVISION?= 7 +PORTREVISION?= 8 CATEGORIES= mail MASTER_SITES+= ${MASTER_SITE_QMAIL} DISTNAME= ${PORTNAME}-${QMAIL_VERSION} @@ -60,7 +60,7 @@ QMAILQUEUE_PATCH_DESC= Run a QMAILQUEUE program QMQP_COMPRESS_DESC= QMQP on the fly compression QMTPC_PATCH_DESC= Send email using qmtp protocol QUOTATRASH_DESC= Include the Trash in the quota -RCDLINK_DESC= Create rc.d/qmail.sh symlink +RCDLINK_DESC= Create rc.d/qmail symlink SENDERCHECK4_DESC= LOOSE checks exclusively for RELAY clients SMTPAUTHUSER_DESC= Create env SMTPAUTHUSER containing authuser SMTPEXECCHECK_DESC= Smtp DOS/Windows executable detection @@ -289,6 +289,10 @@ PKGMESSAGE?= ${WRKDIR}/pkg-message-${PKGMESSAGE_SUFFIX} SUB_FILES+= pkg-message .endif +.if !defined(SLAVE_LDAP) +SUB_FILES+= qmailsmtpd +.endif + WRKDIR_doc= ${WRKDIR}/doc PORTDOCS= * @@ -813,7 +817,7 @@ do-install: ${INSTALL_SCRIPT} ${WRKDIR}/${i:T} ${PREFIX}/boot .endfor .if !defined(SLAVE_LDAP) - ${INSTALL_SCRIPT} ${FILESDIR}/qmail-smtpd.rcNG ${PREFIX}/boot + ${INSTALL_SCRIPT} ${WRKDIR}/qmailsmtpd ${PREFIX}/boot .endif .for i in 1 5 7 8 @${MKDIR} ${PREFIX}/man/man$i diff --git a/mail/qmail/files/pkg-install.in b/mail/qmail/files/pkg-install.in index a1359c8ddcd1..c533138fb401 100644 --- a/mail/qmail/files/pkg-install.in +++ b/mail/qmail/files/pkg-install.in @@ -12,10 +12,10 @@ if [ "$2" = "POST-INSTALL" ]; then [ -e ${PREFIX}/control/me ] || (cd ${PREFIX}/configure && ./config) - %%RCDLINK%%ln -s ${PREFIX}/rc %%LOCALBASE%%/etc/rc.d/qmail.sh + %%RCDLINK%%ln -s ${PREFIX}/rc %%LOCALBASE%%/etc/rc.d/qmailsmtpd %%RCDLINK%%echo "" - %%RCDLINK%%echo "A %%LOCALBASE%%/etc/rc.d/qmail.sh symlink was created. To enable qmail at boot" + %%RCDLINK%%echo "A %%LOCALBASE%%/etc/rc.d/qmailsmtpd symlink was created. To enable qmail at boot" %%RCDLINK%%echo "time you need to copy a script to %%PREFIX%%/rc. There are some examples at" %%RCDLINK%%echo "%%PREFIX%%/boot" %%RCDLINK%%echo "" diff --git a/mail/qmail/files/qmail-smtpd.rcNG b/mail/qmail/files/qmail-smtpd.rcNG deleted file mode 100644 index 7eb43e3b9cbc..000000000000 --- a/mail/qmail/files/qmail-smtpd.rcNG +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh - -# $FreeBSD$ -# -# 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. -# -# qmailsmtpd_checkpassword could be set to e.g. /usr/local/bin/checkpassword-pam - -. /etc/rc.subr - -name="qmailsmtpd" -rcvar=qmailsmtpd_enable -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_checksubprogram="/usr/bin/true"} - -qmailsmtpd_start() { - $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" - fi - - 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 -} - -qmailsmtpd_stop() { - echo "Stopping qmail-smtpd" - kill `cat /var/run/qmailsmtpd.pid` -} - -start_cmd="qmailsmtpd_start" -stop_cmd="qmailsmtpd_stop" -run_rc_command "$1" diff --git a/mail/qmail/files/qmailsmtpd.in b/mail/qmail/files/qmailsmtpd.in new file mode 100644 index 000000000000..936592127ef7 --- /dev/null +++ b/mail/qmail/files/qmailsmtpd.in @@ -0,0 +1,68 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: qmailsmtpd +# REQUIRE: LOGIN cleanvar +# KEYWORD: shutdown +# +# 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. +# +# qmailsmtpd_checkpassword could be set to e.g. /usr/local/bin/checkpassword-pam + +. /etc/rc.subr + +name=qmailsmtpd +rcvar=qmailsmtpd_enable + +load_rc_config $name + +: ${qmailsmtpd_tcpserver:=%%LOCALBASE%%/bin/tcpserver} +: ${qmailsmtpd_tcprules:=%%LOCALBASE%%/bin/tcprules} +: ${qmailsmtpd_pidfile:=/var/run/qmailsmtpd.pid} +: ${qmailsmtpd_enable:=NO} +: ${qmailsmtpd_cdb:=/etc/tcp.smtp} +: ${qmailsmtpd_flags="-R -H -u 82 -g 81"} +: ${qmailsmtpd_host:=0} +: ${qmailsmtpd_port:=smtp} +: ${qmailsmtpd_smtpd:=%%PREFIX%%/bin/qmail-smtpd} +: ${qmailsmtpd_fqdn:=`hostname`} +: ${qmailsmtpd_checksubprogram:=/usr/bin/true} + +start_cmd=qmailsmtpd_start +start_precmd=qmailsmtpd_precmd +pidfile=${qmailsmtpd_pidfile} +procname=${qmailsmtpd_tcprules} + +qmailsmtpd_start() +{ + if [ -n "$qmailsmtpd_checkpassword" ]; then + qmailsmtpd_usercheck="$qmailsmtpd_fqdn $qmailsmtpd_checkpassword $qmailsmtpd_checksubprogram" + fi + + echo "Starting qmailsmtpd." + + $qmailsmtpd_tcpserver -x $qmailsmtpd_cdb.cdb $qmailsmtpd_flags $qmailsmtpd_host $qmailsmtpd_port \ + $qmailsmtpd_smtpd $qmailsmtpd_usercheck & + echo $! > $pidfile +} + +qmailsmtpd_precmd() +{ + if ! [ -e "${qmailsmtpd_tcpserver}" ]; then + echo "sysutils/ucspi-tcp is required" >&2 + return 1 + fi + if ! [ -e "${qmailsmtpd_cdb}" ]; then + echo "TCP rules file '${qmailsmtpd_cdb}' is missing." >&2 + return 1 + fi + $qmailsmtpd_tcprules $qmailsmtpd_cdb.cdb $qmailsmtpd_cdb.tmp < $qmailsmtpd_cdb \ + || return 1 +} + +run_rc_command "$1" diff --git a/mail/qmail/pkg-plist b/mail/qmail/pkg-plist index 926eaf0311e9..64d9f270fd80 100644 --- a/mail/qmail/pkg-plist +++ b/mail/qmail/pkg-plist @@ -1,5 +1,5 @@ @comment $FreeBSD$ -%%RCDLINK%%@unexec rm -f %%LOCALBASE%%/etc/rc.d/qmail.sh +%%RCDLINK%%@unexec rm -f %%LOCALBASE%%/etc/rc.d/qmailsmtpd %%LDAP%%bin/auth_imap %%LDAP%%bin/auth_pop %%LDAP%%bin/auth_smtp @@ -78,7 +78,7 @@ bin/tcp-env %%NOT_LDAP%%boot/maildir %%NOT_LDAP%%boot/proc %%NOT_LDAP%%boot/proc+df -%%NOT_LDAP%%boot/qmail-smtpd.rcNG +%%NOT_LDAP%%boot/qmailsmtpd %%LDAP%%boot/qmail/log/run %%LDAP%%boot/qmail/run %%LDAP%%boot/qmail-smtpd/log/run -- cgit