Bug 117422 - [PATCH] mail/qmail - startup file for qmail-smtpd
[PATCH] mail/qmail - startup file for qmail-smtpd
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Latest
Any Any
: Normal Affects Only Me
Assigned To: Renato Botelho
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-23 12:40 UTC by Nick
Modified: 2007-12-26 16:50 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick 2007-10-23 12:40:02 UTC
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.

Fix: 

#!/bin/sh
#
# 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

name="qmailsmtpd"
rcvar=`set_rcvar`

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_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"
How-To-Repeat: Put it in /usr/local/etc/rc.d and add the appropriate flags in /etc/rc.conf or
/etc/rc.conf.d/qmailsmtpd.
Comment 1 Edwin Groothuis freebsd_committer 2007-10-23 15:53:58 UTC
Responsible Changed
From-To: freebsd-ports-bugs->garga

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter freebsd_committer 2007-12-26 16:44:00 UTC
garga       2007-12-26 16:43:55 UTC

  FreeBSD ports repository

  Modified files:
    mail/qmail           Makefile pkg-plist 
    mail/qmail-mysql     Makefile 
    mail/qmail-spamcontrol Makefile 
    mail/qmail-tls       Makefile 
  Added files:
    mail/qmail/files     extra-patch-amd64 qmail-smtpd.rcNG 
  Log:
  - Fix a segfault on amd64 (except on qmail-spamcontrol and qmail-ldap) [1]
  - Add an rcNG startup example file to QMAIL_PREFIX/boot [2]
  - Bump PORTREVISION due to rcNG add (except for qmail-ldap)
  - Fix make certificate to add ciphers file to QMAIL_PREFIX/control [3]
  
  PR:             ports/118117 [1], ports/117422 [2], ports/118198 [3]
  Submitted by:   Andrew Reilly <areilly@bigpond.net.au> [1] [3]
                  Nick@van-laarhoven.org [2]
  
  Revision  Changes    Path
  1.20      +1 -1      ports/mail/qmail-mysql/Makefile
  1.23      +1 -1      ports/mail/qmail-spamcontrol/Makefile
  1.22      +1 -1      ports/mail/qmail-tls/Makefile
  1.126     +10 -1     ports/mail/qmail/Makefile
  1.1       +20 -0     ports/mail/qmail/files/extra-patch-amd64 (new)
  1.1       +52 -0     ports/mail/qmail/files/qmail-smtpd.rcNG (new)
  1.17      +2 -1      ports/mail/qmail/pkg-plist
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 3 Renato Botelho freebsd_committer 2007-12-26 16:44:33 UTC
State Changed
From-To: open->closed

Committed. Thanks!