network/netqmail: Added (the qmail MTA).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
parent
a8e78c52c7
commit
888ec031ac
|
@ -0,0 +1,305 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Dave Sill, 2003-11-10
|
||||
# http://lifewithqmail.org/inst_check
|
||||
|
||||
# set to n if you're not running a pop3 server, y if you are
|
||||
CHECKPOP=n
|
||||
|
||||
QMHOME=/var/qmail
|
||||
LBIN=/usr/bin
|
||||
|
||||
OK=1
|
||||
|
||||
if [ $# -eq 1 ]; then
|
||||
if [ "$1" = "-v" ]; then
|
||||
VERB=y
|
||||
else
|
||||
VERB=n
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -d $QMHOME ]; then
|
||||
echo "! Couldn't find qmail's home directory, $QMHOME!"
|
||||
else
|
||||
if [ "$VERB" = y ]; then
|
||||
echo "$QMHOME exists"
|
||||
fi
|
||||
for i in alias bin boot control queue supervise users; do
|
||||
if [ ! -d $QMHOME/$i ]; then
|
||||
echo "! Couldn't find $QMHOME/$i!"
|
||||
OK=0
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "$QMHOME/$i exists"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -f $QMHOME/rc ]; then
|
||||
echo "! $QMHOME/rc is missing"
|
||||
OK=0
|
||||
elif [ ! -x $QMHOME/rc ]; then
|
||||
echo "! $QMHOME/rc is not executable"
|
||||
echo "...try: chmod 755 $QMHOME/rc"
|
||||
OK=0
|
||||
elif [ `head -1 $QMHOME/rc|cat -vet` != '#!/bin/sh$' ]; then
|
||||
echo "! $QMHOME/rc has bad magic cookie"
|
||||
echo "...try: dos2unix $QMHOME/rc"
|
||||
OK=0
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "$QMHOME/rc is executable and has a valid magic cookie"
|
||||
fi
|
||||
fi
|
||||
|
||||
for i in alias qmaild qmaill qmailp qmailq qmailr qmails; do
|
||||
grep "^$i:" /etc/passwd >/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "! Couldn't find $i user in /etc/passwd"
|
||||
OK=0
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "$i user exists"
|
||||
fi
|
||||
done
|
||||
|
||||
for i in qmail nofiles; do
|
||||
grep "^$i:" /etc/group >/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "! Couldn't find $i group in /etc/group"
|
||||
OK=0
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "$i group exists"
|
||||
fi
|
||||
done
|
||||
|
||||
for i in tcprules tcpserver; do
|
||||
if [ ! -x $LBIN/$i ]; then
|
||||
echo "! Couldn't find $LBIN/$i from ucspi-tcp"
|
||||
OK=0
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "$i from ucspi-tcp is installed"
|
||||
fi
|
||||
done
|
||||
|
||||
for i in multilog softlimit setuidgid supervise svok svscan tai64nlocal; do
|
||||
if [ ! -x $LBIN/$i ]; then
|
||||
echo "! Couldn't find $LBIN/$i from daemontools"
|
||||
OK=0
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "$i from daemontools is installed"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -d /service ]; then
|
||||
echo "! /service directory is missing"
|
||||
OK=0
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "/service directory exists"
|
||||
fi
|
||||
|
||||
if [ -f /etc/inittab ]; then
|
||||
grep "^SV" /etc/inittab >/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "! Couldn't find SV entry in inittab"
|
||||
OK=0
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "svscan /service is configured to run via /etc/inittab"
|
||||
fi
|
||||
PS="ps -ef"
|
||||
else
|
||||
grep "svscanboot" /etc/rc.local >/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "! Couldn't find 'csh -cf '/command/svscanboot &' in /etc/rc.local"
|
||||
OK=0
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "/command/svscanboot is configured to run via /etc/rc.local"
|
||||
fi
|
||||
PS="ps -waux"
|
||||
fi
|
||||
|
||||
SVRUN=`$PS | grep "svscan /service" | grep -v grep`
|
||||
if [ -z "$SVRUN" ]; then
|
||||
echo "'! svscan /service' doesn't seem to be running"
|
||||
OK=0
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "svscan /service is running"
|
||||
fi
|
||||
|
||||
if [ ! -f $QMHOME/control/defaultdelivery ]; then
|
||||
echo "! Couldn't find $QMHOME/control/defaultdelivery"
|
||||
OK=0
|
||||
elif [ ! -s $QMHOME/control/defaultdelivery ]; then
|
||||
echo "! $QMHOME/control/defaultdelivery is empty"
|
||||
OK=0
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "$QMHOME/control/defaultdelivery looks OK"
|
||||
fi
|
||||
|
||||
if [ ! -f $QMHOME/bin/qmailctl ]; then
|
||||
echo "! $QMHOME/bin/qmailctl is missing"
|
||||
OK=0
|
||||
elif [ ! -s $QMHOME/bin/qmailctl ]; then
|
||||
echo "! $QMHOME/bin/qmailctl is empty"
|
||||
OK=0
|
||||
elif [ `head -1 $QMHOME/bin/qmailctl|cat -vet` != '#!/bin/sh$' ]; then
|
||||
echo "! $QMHOME/bin/qmailctl has bad magic cookie"
|
||||
echo "...try: dos2unix $QMHOME/bin/qmailctl"
|
||||
OK=0
|
||||
elif [ ! -x $QMHOME/bin/qmailctl ]; then
|
||||
echo "! $QMHOME/bin/qmailctl is not executable"
|
||||
echo "...try: chmod 755 $QMHOME/bin/qmailctl"
|
||||
OK=0
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "$QMHOME/bin/qmailctl looks OK"
|
||||
fi
|
||||
if [ ! -L /usr/bin/qmailctl ]; then
|
||||
echo "! /usr/bin/qmailctl is missing"
|
||||
echo "...try: ln -s $QMHOME/bin/qmailctl /usr/bin"
|
||||
OK=0
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "/usr/bin/qmailctl exists"
|
||||
fi
|
||||
|
||||
SVCDIRS="qmail-send qmail-send/log qmail-smtpd qmail-smtpd/log"
|
||||
if [ "$CHECKPOP" = "y" ]; then
|
||||
SVCDIRS="$SVCDIRS qmail-pop3d qmail-pop3d/log"
|
||||
fi
|
||||
for i in $SVCDIRS; do
|
||||
if [ ! -f $QMHOME/supervise/$i/run ]; then
|
||||
echo "! $QMHOME/supervise/$i/run file is missing"
|
||||
OK=0
|
||||
elif [ `head -1 $QMHOME/supervise/$i/run|cat -vet` != '#!/bin/sh$' ]; then
|
||||
echo "! $QMHOME/supervise/$i/run has bad magic cookie"
|
||||
echo "...try: dos2unix $QMHOME/supervise/$i/run"
|
||||
OK=0
|
||||
elif [ ! -x $QMHOME/supervise/$i/run ]; then
|
||||
echo "! $QMHOME/supervise/$i/run file is not executable"
|
||||
OK=0
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "$QMHOME/supervise/$i/run looks OK"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -f $QMHOME/control/concurrencyincoming ]; then
|
||||
echo "! $QMHOME/control/concurrencyincoming is missing"
|
||||
echo "...try: echo 20 >$QMHOME/control/concurrencyincoming"
|
||||
OK=0
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "$QMHOME/control/concurrencyincoming looks OK"
|
||||
fi
|
||||
|
||||
LOGDIRS="/var/log/qmail /var/log/qmail/smtpd"
|
||||
if [ "$CHECKPOP" = "y" ]; then
|
||||
LOGDIRS="$LOGDIRS /var/log/qmail/pop3d"
|
||||
fi
|
||||
for i in $LOGDIRS; do
|
||||
if [ ! -d $i ]; then
|
||||
echo "! $i is missing"
|
||||
echo "...try: mkdir -p $i"
|
||||
OK=0
|
||||
elif [ "`ls -ld $i|awk '{print $3}'`" != "qmaill" ]; then
|
||||
echo "! $i has wrong owner, should be qmaill"
|
||||
echo "...try: chown qmaill $i"
|
||||
OK=0
|
||||
elif [ "`ls -ld $i|awk '{print $1}'`" != "drwxr-xr-x" ]; then
|
||||
echo "! $i has wrong mode, should be 755"
|
||||
echo "...try: chmod 755 $i"
|
||||
OK=0
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "$i looks OK"
|
||||
fi
|
||||
done
|
||||
|
||||
SVCLINKS="/service/qmail-send /service/qmail-smtpd"
|
||||
if [ "$CHECKPOP" = "y" ]; then
|
||||
SVCLINKS="$SVCLINKS /service/qmail-pop3d"
|
||||
fi
|
||||
for i in $SVCLINKS; do
|
||||
if [ ! -L $i ]; then
|
||||
echo "! $i is missing"
|
||||
echo "...try: ln -s $QMHOME$i $i"
|
||||
OK=0
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "$i exists"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -f /etc/tcp.smtp ]; then
|
||||
echo "! /etc/tcp.smtp is missing"
|
||||
echo "...try: echo '127.:allow,RELAYCLIENT=\"\"' >>/etc/tcp.smtp"
|
||||
OK=0
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "/etc/tcp.smtp exists"
|
||||
fi
|
||||
|
||||
if [ ! -f /etc/tcp.smtp.cdb ]; then
|
||||
echo "! /etc/tcp.smtp.cdb is missing"
|
||||
echo "...try: $QMHOME/bin/qmailctl cdb"
|
||||
OK=0
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "/etc/tcp.smtp.cdb exists"
|
||||
fi
|
||||
|
||||
AHOME=`grep "^alias:" /etc/passwd | awk -F: '{print $6}'`
|
||||
if [ -z "$AHOME" ]; then
|
||||
echo "! Couldn't find user alias's home directory"
|
||||
OK=0
|
||||
else
|
||||
for i in root postmaster mailer-daemon; do
|
||||
if [ ! -f $AHOME/.qmail-$i ]; then
|
||||
echo "! Alias for $i is missing"
|
||||
echo "...try: echo me >$AHOME/.qmail-$i"
|
||||
OK=0
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "$i alias exists"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if netstat -a | grep smtp | grep -i listen >/dev/null; then
|
||||
if $PS | grep sendmail | grep -v grep >/dev/null; then
|
||||
echo "! Sendmail is still running"
|
||||
echo "...try: $RCDIR/init.d/sendmail stop"
|
||||
OK=0
|
||||
elif $LBIN/svok /service/qmail-smtpd; then
|
||||
if [ "$VERB" = y ]; then
|
||||
echo "/service/qmail-smtpd is running"
|
||||
fi
|
||||
else
|
||||
echo "! Something is listening on port 25 (not tcpserver/qmail-smtpd)"
|
||||
echo "...try: disabling current MTA"
|
||||
OK=0
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$CHECKPOP" = "y" ]; then
|
||||
if netstat -a | grep pop | grep -i listen >/dev/null; then
|
||||
if $LBIN/svok /service/qmail-pop3d; then
|
||||
if [ "$VERB" = y ]; then
|
||||
echo "/service/qmail-pop3d is running"
|
||||
fi
|
||||
else
|
||||
echo "! Something is listening on port 110 (not tcpserver/qmail-pop3d)"
|
||||
echo "...try: disabling other POP server"
|
||||
OK=0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
for i in /usr/lib/sendmail /usr/sbin/sendmail; do
|
||||
if [ -f $i -a ! -L $i ]; then
|
||||
echo "! $i is a file, should be a link"
|
||||
echo "...try: uninstalling current MTA or: mv $i $i.old; ln -s $QMHOME/bin/sendmail $i"
|
||||
OK=0
|
||||
elif [ ! -f $i ];then
|
||||
echo "! $i is missing"
|
||||
echo "...try: ln -s $QMHOME/bin/sendmail $i"
|
||||
OK=0
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "$i exists"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $OK -eq 1 ]; then
|
||||
echo "Congratulations, your LWQ installation looks good!"
|
||||
elif [ "$VERB" = y ]; then
|
||||
echo "! Potential problems were found with your LWQ installation"
|
||||
fi
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
exec /usr/bin/setuidgid qmaill /usr/bin/multilog t /var/log/qmail
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
exec /var/qmail/rc
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
exec /usr/bin/setuidgid qmaill /usr/bin/multilog t /var/log/qmail/smtpd
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/sh
|
||||
|
||||
QMAILDUID=`id -u qmaild`
|
||||
NOFILESGID=`id -g qmaild`
|
||||
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
|
||||
LOCAL=`head -1 /var/qmail/control/me`
|
||||
|
||||
if [ -z "$QMAILDUID" -o -z "$NOFILESGID" -o -z "$MAXSMTPD" -o -z "$LOCAL" ]; then
|
||||
echo QMAILDUID, NOFILESGID, MAXSMTPD, or LOCAL is unset in
|
||||
echo /var/qmail/supervise/qmail-smtpd/run
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f /var/qmail/control/rcpthosts ]; then
|
||||
echo "No /var/qmail/control/rcpthosts!"
|
||||
echo "Refusing to start SMTP listener because it'll create an open relay"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec /usr/bin/softlimit -m 20000000 \
|
||||
/usr/bin/tcpserver -v -R -l "$LOCAL" -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \
|
||||
-u "$QMAILDUID" -g "$NOFILESGID" 0 smtp /var/qmail/bin/qmail-smtpd 2>&1
|
|
@ -0,0 +1,109 @@
|
|||
#!/bin/sh
|
||||
|
||||
# For Red Hat chkconfig
|
||||
# chkconfig: - 80 30
|
||||
# description: the qmail MTA
|
||||
|
||||
PATH=/var/qmail/bin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin
|
||||
export PATH
|
||||
|
||||
QMAILDUID=`id -u qmaild`
|
||||
NOFILESGID=`id -g qmaild`
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo "Starting qmail"
|
||||
if svok /service/qmail-send ; then
|
||||
svc -u /service/qmail-send /service/qmail-send/log
|
||||
else
|
||||
echo "qmail-send supervise not running"
|
||||
fi
|
||||
if svok /service/qmail-smtpd ; then
|
||||
svc -u /service/qmail-smtpd /service/qmail-smtpd/log
|
||||
else
|
||||
echo "qmail-smtpd supervise not running"
|
||||
fi
|
||||
if [ -d /var/lock/subsys ]; then
|
||||
touch /var/lock/subsys/qmail
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
echo "Stopping qmail..."
|
||||
echo " qmail-smtpd"
|
||||
svc -d /service/qmail-smtpd /service/qmail-smtpd/log
|
||||
echo " qmail-send"
|
||||
svc -d /service/qmail-send /service/qmail-send/log
|
||||
if [ -f /var/lock/subsys/qmail ]; then
|
||||
rm /var/lock/subsys/qmail
|
||||
fi
|
||||
;;
|
||||
stat)
|
||||
svstat /service/qmail-send
|
||||
svstat /service/qmail-send/log
|
||||
svstat /service/qmail-smtpd
|
||||
svstat /service/qmail-smtpd/log
|
||||
qmail-qstat
|
||||
;;
|
||||
doqueue|alrm|flush)
|
||||
echo "Flushing timeout table and sending ALRM signal to qmail-send."
|
||||
/var/qmail/bin/qmail-tcpok
|
||||
svc -a /service/qmail-send
|
||||
;;
|
||||
queue)
|
||||
qmail-qstat
|
||||
qmail-qread
|
||||
;;
|
||||
reload|hup)
|
||||
echo "Sending HUP signal to qmail-send."
|
||||
svc -h /service/qmail-send
|
||||
;;
|
||||
pause)
|
||||
echo "Pausing qmail-send"
|
||||
svc -p /service/qmail-send
|
||||
echo "Pausing qmail-smtpd"
|
||||
svc -p /service/qmail-smtpd
|
||||
;;
|
||||
cont)
|
||||
echo "Continuing qmail-send"
|
||||
svc -c /service/qmail-send
|
||||
echo "Continuing qmail-smtpd"
|
||||
svc -c /service/qmail-smtpd
|
||||
;;
|
||||
restart)
|
||||
echo "Restarting qmail:"
|
||||
echo "* Stopping qmail-smtpd."
|
||||
svc -d /service/qmail-smtpd /service/qmail-smtpd/log
|
||||
echo "* Sending qmail-send SIGTERM and restarting."
|
||||
svc -t /service/qmail-send /service/qmail-send/log
|
||||
echo "* Restarting qmail-smtpd."
|
||||
svc -u /service/qmail-smtpd /service/qmail-smtpd/log
|
||||
;;
|
||||
cdb)
|
||||
tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
|
||||
chmod 644 /etc/tcp.smtp.cdb
|
||||
echo "Reloaded /etc/tcp.smtp."
|
||||
;;
|
||||
help)
|
||||
cat <<HELP
|
||||
stop -- stops mail service (smtp connections refused, nothing goes out)
|
||||
start -- starts mail service (smtp connection accepted, mail can go out)
|
||||
pause -- temporarily stops mail service (connections accepted, nothing leaves)
|
||||
cont -- continues paused mail service
|
||||
stat -- displays status of mail service
|
||||
cdb -- rebuild the tcpserver cdb file for smtp
|
||||
restart -- stops and restarts smtp, sends qmail-send a TERM & restarts it
|
||||
doqueue -- schedules queued messages for immediate delivery
|
||||
reload -- sends qmail-send HUP, rereading locals and virtualdomains
|
||||
queue -- shows status of queue
|
||||
alrm -- same as doqueue
|
||||
flush -- same as doqueue
|
||||
hup -- same as reload
|
||||
HELP
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|doqueue|flush|reload|stat|pause|cont|cdb|queue|help}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Using stdout for logging
|
||||
# Using control/defaultdelivery from qmail-local to deliver messages by default
|
||||
|
||||
exec env - PATH="/var/qmail/bin:$PATH" \
|
||||
qmail-start "`cat /var/qmail/control/defaultdelivery`"
|
|
@ -0,0 +1,17 @@
|
|||
netqmail - djb's qmail mta.
|
||||
|
||||
This package is intended for folk who are using qmail now and might
|
||||
like a clean way to install and remove the latest version there is.
|
||||
|
||||
daemontools is an optional dependency, highly recommended.
|
||||
|
||||
The following 2 changes are made to the installed layout:
|
||||
|
||||
1. man pages formerly under /var/qmail/man are moved to /usr/man, and
|
||||
2. documentation formerly under /var/qmail/doc is moved to the usual
|
||||
Slackware documentation location.
|
||||
|
||||
Please see README.SBo for important information on how to build and
|
||||
install this package.
|
||||
|
||||
You can perform test installs to a chroot environment - see tests/README.
|
|
@ -0,0 +1,88 @@
|
|||
You must stop your running MTA before installing or upgrading netqmail,
|
||||
unless you built with DO_CONFIG=no (see below)
|
||||
If your running MTA is qmail, you can stop it by entering "qmailctl stop".
|
||||
|
||||
The principal reference for how to install and configure qmail is "Life
|
||||
with qmail" herinafter referred to as LWQ. URL is
|
||||
http://www.lifewithqmail.org/lwq.html.
|
||||
|
||||
This SlackBuild can be configured to perform all the steps in LWQ
|
||||
section 2 (Installation) except 2.9 (Test the Installation).
|
||||
|
||||
SETTING TMP
|
||||
|
||||
This SlackBuild uses mkchroot, which runs best if the TMP directory is on the
|
||||
same file system as /usr. If you normally mount /tmp, you may want to use
|
||||
|
||||
TMP=/usr/localtmp ./netqmail.SlackBuild
|
||||
|
||||
otherwise if you are going to build using a mounted /tmp then put
|
||||
|
||||
MKCHROOT_IGNORE_LN_ERRORS=yes ./netqmail.SlackBuild
|
||||
|
||||
to prevent copious error messages. The build will use >200M of file space.
|
||||
(when mkchroot fails to make a hard link, it does a "cp -a" instead. The errors
|
||||
are not suppressed so the user can ^C out and make the target somewhere else).
|
||||
|
||||
QMAIL USERS AND GROUPS
|
||||
|
||||
Qmail needs 7 users and 2 groups. By default, installing netqmail will create
|
||||
them if they do not already exist on the target system. To prevent this:
|
||||
|
||||
INSTALL_USERS=no ./netqmail.SlackBuild
|
||||
|
||||
User and group ids have been assigned by SBo. However if usrs or groups already
|
||||
exist on the build system then their ids are used instead. If they don't exist
|
||||
on the build system, you can force them to be other than the default bu e.g.:
|
||||
|
||||
NOFILES_GROUP=1001 ALIAS_USER=1001 ./netqmail.SlackBuild
|
||||
|
||||
At least some of the qmail users and groups are compiled into the C code. The
|
||||
compile is done in a chroot environment so the build system's /etc/passwd can
|
||||
be left untouched. uids & gids defined, discovered or defaulted as above are
|
||||
used in the chroot build.
|
||||
|
||||
QMAIL CONFIGURATION
|
||||
|
||||
By default, the SlackBuild implements a number of other steps from LWQ section 2
|
||||
(in addition to creating users, above). To completely disable this:
|
||||
|
||||
DO_CONFIG=no ./netqmail.SlackBuild
|
||||
|
||||
If uou specified the above, the rest of this README does not apply: stop
|
||||
reading now.
|
||||
|
||||
MAIL ADMININISTRATOR
|
||||
|
||||
RFC 2821 requires that "postmaster" be a real user who can receive mail.
|
||||
qmail implements this requirement via its aliasing system. LWQ uses the example
|
||||
user "dave":
|
||||
|
||||
ADMIN_USER=dave ./netqmail.SlackBuild
|
||||
|
||||
mail to postmaster will now be sent to dave. Mail to root is also sent to dave,
|
||||
via a separate entry in /var/wmail/alias. To see these, use "ls -A" since all
|
||||
files in /var/wmail/alias are hidden.
|
||||
User "mailer-daemon" is a de-facto standard recipient for some bounces. User
|
||||
"abuse" is a de facto standard recipient for abuse complaints. These 2 names are
|
||||
symlinked to the postmaster entry in /var/wmail/alias.
|
||||
|
||||
AUTOMATIC START UP
|
||||
|
||||
qmail was written to be controllable by daemontools. To configure that
|
||||
daemontools will start qmail, put:
|
||||
|
||||
ADMIN_USER=dave SYMLINK_SERVICE=yes ./netqmail.SlackBuild
|
||||
|
||||
Note that it is an error to request automatic start up without specifying a
|
||||
mail admininistrator.
|
||||
With this option enabled, qmail should start by itself soon after installation.
|
||||
|
||||
DEFAULT MAIL DELIVERY METHOD
|
||||
|
||||
qmail supports delivery to the traditional mbox format (1 file per user) or the
|
||||
newer Maildir format (1 file per email). Users can set their preference in
|
||||
~/.qmail; otherwise they get the system default. The default built default
|
||||
method is mbox. To change this to Maildir, put:
|
||||
|
||||
MAILDIR=yes ./netqmail.SlackBuild
|
|
@ -0,0 +1 @@
|
|||
chroot . /bin/sh /usr/doc/netqmail-1.06/install_scripts/doinst_sh
|
|
@ -0,0 +1,30 @@
|
|||
# LWQ 2.5.5
|
||||
cd /usr/doc/netqmail-1.06/install_scripts
|
||||
./config
|
||||
cd /var/qmail/control
|
||||
for i in me defaultdomain plusdomain locals rcpthosts
|
||||
do
|
||||
config $i.new
|
||||
done
|
||||
|
||||
#LWQ 2.8.2.3
|
||||
grep -q '127.:allow,RELAYCLIENT=""' /etc/tcp.smtp 2>/dev/null ||
|
||||
echo '127.:allow,RELAYCLIENT=""' >>/etc/tcp.smtp
|
||||
qmailctl cdb
|
||||
|
||||
# LWQ 2.8.3
|
||||
for i in /usr/lib /usr/sbin
|
||||
do
|
||||
if [ -e $i/sendmail ]
|
||||
then
|
||||
if [ $(readlink -f $i/sendmail) != /var/qmail/bin/sendmail ]
|
||||
then
|
||||
mv $i/sendmail $i/sendmail.old
|
||||
chmod 0 $i/sendmail.old
|
||||
ln -s /var/qmail/bin/sendmail $i
|
||||
fi
|
||||
else
|
||||
rm -f $i/sendmail # Could be a dangling symlink
|
||||
ln -s /var/qmail/bin/sendmail $i
|
||||
fi
|
||||
done
|
|
@ -0,0 +1,9 @@
|
|||
config() {
|
||||
NEW="$1"
|
||||
OLD="$(dirname $NEW)/$(basename $NEW .new)"
|
||||
if [ ! -r $OLD ]; then
|
||||
mv $NEW $OLD
|
||||
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
|
||||
rm $NEW
|
||||
fi
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
# LWQ 2.8.2.2
|
||||
if [ -d /service ]
|
||||
then
|
||||
for i in qmail-send qmail-smtpd
|
||||
do
|
||||
[ -L /service/$i -o -e /service/$i ] ||
|
||||
ln -s /var/qmail/supervise/$i /service
|
||||
done
|
||||
else
|
||||
echo "There is no /service directory" >&2
|
||||
echo "Did you install daemontools?" >&2
|
||||
fi
|
|
@ -0,0 +1,18 @@
|
|||
grep -q ^nofiles: /etc/group ||
|
||||
groupadd -g 340 nofiles
|
||||
grep -q ^alias: /etc/passwd ||
|
||||
useradd -r -g nofiles -d /var/qmail/alias -u 339 -s "" alias
|
||||
grep -q ^qmaild: /etc/passwd ||
|
||||
useradd -r -g nofiles -d /var/qmail -u 340 -s "" qmaild
|
||||
grep -q ^qmaill: /etc/passwd ||
|
||||
useradd -r -g nofiles -d /var/qmail -u 341 -s "" qmaill
|
||||
grep -q ^qmailp: /etc/passwd ||
|
||||
useradd -r -g nofiles -d /var/qmail -u 342 -s "" qmailp
|
||||
grep -q ^qmail: /etc/group ||
|
||||
groupadd -g 339 qmail
|
||||
grep -q ^qmailq: /etc/passwd ||
|
||||
useradd -r -g qmail -d /var/qmail -u 343 -s "" qmailq
|
||||
grep -q ^qmailr: /etc/passwd ||
|
||||
useradd -r -g qmail -d /var/qmail -u 344 -s "" qmailr
|
||||
grep -q ^qmails: /etc/passwd ||
|
||||
useradd -r -g qmail -d /var/qmail -u 345 -s "" qmails
|
|
@ -0,0 +1,97 @@
|
|||
--- config-fast.sh 1998/06/15 10:53:16 1.1
|
||||
+++ config-fast.sh 2017/02/07 01:58:27
|
||||
@@ -2,29 +2,29 @@
|
||||
echo Your fully qualified host name is "$fqdn".
|
||||
|
||||
echo Putting "$fqdn" into control/me...
|
||||
-echo "$fqdn" > QMAIL/control/me
|
||||
-chmod 644 QMAIL/control/me
|
||||
+echo "$fqdn" > QMAIL/control/me.new
|
||||
+chmod 644 QMAIL/control/me.new
|
||||
|
||||
( echo "$fqdn" | sed 's/^\([^\.]*\)\.\([^\.]*\)\./\2\./' | (
|
||||
read ddom
|
||||
echo Putting "$ddom" into control/defaultdomain...
|
||||
- echo "$ddom" > QMAIL/control/defaultdomain
|
||||
- chmod 644 QMAIL/control/defaultdomain
|
||||
+ echo "$ddom" > QMAIL/control/defaultdomain.new
|
||||
+ chmod 644 QMAIL/control/defaultdomain.new
|
||||
) )
|
||||
|
||||
( echo "$fqdn" | sed 's/^.*\.\([^\.]*\)\.\([^\.]*\)$/\1.\2/' | (
|
||||
read pdom
|
||||
echo Putting "$pdom" into control/plusdomain...
|
||||
- echo "$pdom" > QMAIL/control/plusdomain
|
||||
- chmod 644 QMAIL/control/plusdomain
|
||||
+ echo "$pdom" > QMAIL/control/plusdomain.new
|
||||
+ chmod 644 QMAIL/control/plusdomain.new
|
||||
) )
|
||||
|
||||
echo Putting "$fqdn" into control/locals...
|
||||
-echo "$fqdn" >> QMAIL/control/locals
|
||||
-chmod 644 QMAIL/control/locals
|
||||
+echo "$fqdn" >> QMAIL/control/locals.new
|
||||
+chmod 644 QMAIL/control/locals.new
|
||||
|
||||
echo Putting "$fqdn" into control/rcpthosts...
|
||||
-echo "$fqdn" >> QMAIL/control/rcpthosts
|
||||
-chmod 644 QMAIL/control/rcpthosts
|
||||
+echo "$fqdn" >> QMAIL/control/rcpthosts.new
|
||||
+chmod 644 QMAIL/control/rcpthosts.new
|
||||
echo "Now qmail will refuse to accept SMTP messages except to $fqdn."
|
||||
echo 'Make sure to change rcpthosts if you add hosts to locals or virtualdomains!'
|
||||
--- config.sh 1998/06/15 10:53:16 1.1
|
||||
+++ config.sh 2017/02/07 01:51:04
|
||||
@@ -7,24 +7,24 @@
|
||||
then
|
||||
echo Your host\'s fully qualified name in DNS is "$fqdn".
|
||||
echo Putting "$fqdn" into control/me...
|
||||
- echo "$fqdn" > QMAIL/control/me
|
||||
- chmod 644 QMAIL/control/me
|
||||
+ echo "$fqdn" > QMAIL/control/me.new
|
||||
+ chmod 644 QMAIL/control/me.new
|
||||
( echo "$fqdn" | sed 's/^\([^\.]*\)\.\([^\.]*\)\./\2\./' | (
|
||||
read ddom
|
||||
echo Putting "$ddom" into control/defaultdomain...
|
||||
- echo "$ddom" > QMAIL/control/defaultdomain
|
||||
- chmod 644 QMAIL/control/defaultdomain
|
||||
+ echo "$ddom" > QMAIL/control/defaultdomain.new
|
||||
+ chmod 644 QMAIL/control/defaultdomain.new
|
||||
) )
|
||||
( echo "$fqdn" | sed 's/^.*\.\([^\.]*\)\.\([^\.]*\)$/\1.\2/' | (
|
||||
read pdom
|
||||
echo Putting "$pdom" into control/plusdomain...
|
||||
- echo "$pdom" > QMAIL/control/plusdomain
|
||||
- chmod 644 QMAIL/control/plusdomain
|
||||
+ echo "$pdom" > QMAIL/control/plusdomain.new
|
||||
+ chmod 644 QMAIL/control/plusdomain.new
|
||||
) )
|
||||
echo ' '
|
||||
echo Checking local IP addresses:
|
||||
- : > QMAIL/control/locals
|
||||
- chmod 644 QMAIL/control/locals
|
||||
+ : > QMAIL/control/locals.new
|
||||
+ chmod 644 QMAIL/control/locals.new
|
||||
( ./dnsip "$fqdn"
|
||||
./ipmeprint ) | sort -u | \
|
||||
(
|
||||
@@ -35,7 +35,7 @@
|
||||
if read local
|
||||
then
|
||||
echo Adding "$local" to control/locals...
|
||||
- echo "$local" >> QMAIL/control/locals
|
||||
+ echo "$local" >> QMAIL/control/locals.new
|
||||
else
|
||||
echo PTR lookup failed. I assume this address has no DNS name.
|
||||
fi
|
||||
@@ -48,8 +48,8 @@
|
||||
echo You don\'t have to worry about aliases, i.e., domains with CNAME records.
|
||||
echo ' '
|
||||
echo Copying QMAIL/control/locals to QMAIL/control/rcpthosts...
|
||||
- cp QMAIL/control/locals QMAIL/control/rcpthosts
|
||||
- chmod 644 QMAIL/control/rcpthosts
|
||||
+ cp QMAIL/control/locals.new QMAIL/control/rcpthosts.new
|
||||
+ chmod 644 QMAIL/control/rcpthosts.new
|
||||
echo 'Now qmail will refuse to accept SMTP messages except to those hosts.'
|
||||
echo 'Make sure to change rcpthosts if you add hosts to locals or virtualdomains!'
|
||||
else
|
|
@ -0,0 +1,55 @@
|
|||
--- INSTALL.vsm 1998/06/15 10:53:16 1.1
|
||||
+++ INSTALL.vsm 2017/02/20 08:47:19
|
||||
@@ -43,7 +43,7 @@
|
||||
3. Using sendmail's delivery agent
|
||||
|
||||
sendmail uses binmail to deliver to /var/spool/mail. binmail is shipped
|
||||
-with the operating system as /bin/mail or /usr/libexec/mail.local.
|
||||
+with the operating system as /bin/mail or /usr/sbin/mail.local.
|
||||
|
||||
There is some variation in binmail syntax among systems. The most common
|
||||
interfaces are shown in /var/qmail/boot/binm1, /var/qmail/boot/binm2,
|
||||
--- REMOVE.binmail 1998/06/15 10:53:16 1.1
|
||||
+++ REMOVE.binmail 2017/02/20 08:47:19
|
||||
@@ -2,11 +2,11 @@
|
||||
configured qmail to use binmail for local delivery.
|
||||
|
||||
|
||||
-1. Find the binmail binary on your system: /usr/libexec/mail.local if
|
||||
+1. Find the binmail binary on your system: /usr/sbin/mail.local if
|
||||
that exists, otherwise /bin/mail.
|
||||
|
||||
2. Remove permissions from the binmail binary:
|
||||
- # chmod 0 /usr/libexec/mail.local
|
||||
+ # chmod 0 /usr/sbin/mail.local
|
||||
|
||||
3. If the binmail binary was /bin/mail, make sure that ``mail'' still
|
||||
invokes a usable mailer. Under SVR4 you may want to link mail to
|
||||
--- binm1+df.sh 1998/06/15 10:53:16 1.1
|
||||
+++ binm1+df.sh 2017/02/20 08:47:19
|
||||
@@ -3,9 +3,9 @@
|
||||
# Using splogger to send the log through syslog.
|
||||
# Using dot-forward to support sendmail-style ~/.forward files.
|
||||
# Using binmail to deliver messages to /var/spool/mail/$USER by default.
|
||||
-# Using BSD 4.4 binmail interface: /usr/libexec/mail.local -r
|
||||
+# Using BSD 4.4 binmail interface: /usr/sbin/mail.local -r
|
||||
|
||||
exec env - PATH="QMAIL/bin:$PATH" \
|
||||
qmail-start '|dot-forward .forward
|
||||
-|preline -f /usr/libexec/mail.local -r "${SENDER:-MAILER-DAEMON}" -d "$USER"' \
|
||||
+|preline -f /usr/sbin/mail.local -r "${SENDER:-MAILER-DAEMON}" -d "$USER"' \
|
||||
splogger qmail
|
||||
--- binm1.sh 1998/06/15 10:53:16 1.1
|
||||
+++ binm1.sh 2017/02/20 08:47:19
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
# Using splogger to send the log through syslog.
|
||||
# Using binmail to deliver messages to /var/spool/mail/$USER by default.
|
||||
-# Using BSD 4.4 binmail interface: /usr/libexec/mail.local -r
|
||||
+# Using BSD 4.4 binmail interface: /usr/sbin/mail.local -r
|
||||
|
||||
exec env - PATH="QMAIL/bin:$PATH" \
|
||||
qmail-start \
|
||||
-'|preline -f /usr/libexec/mail.local -r "${SENDER:-MAILER-DAEMON}" -d "$USER"' \
|
||||
+'|preline -f /usr/sbin/mail.local -r "${SENDER:-MAILER-DAEMON}" -d "$USER"' \
|
||||
splogger qmail
|
|
@ -0,0 +1,271 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Slackware build script for netqmail
|
||||
|
||||
# Copyright 2017 Duncan Roe, Melbourne, Australia
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use of this script, with or without modification, is
|
||||
# permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of this script must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
PRGNAM=netqmail
|
||||
VERSION=${VERSION:-1.06}
|
||||
BUILD=${BUILD:-1}
|
||||
TAG=${TAG:-_SBo}
|
||||
|
||||
if [ -z "$ARCH" ]; then
|
||||
case "$( uname -m )" in
|
||||
i?86) ARCH=i586 ;;
|
||||
arm*) ARCH=arm ;;
|
||||
*) ARCH=$( uname -m ) ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
CWD=$(pwd)
|
||||
TMP=${TMP:-/tmp/SBo}
|
||||
PKG=$TMP/package-$PRGNAM
|
||||
OUTPUT=${OUTPUT:-/tmp}
|
||||
DOCDIR=$PKG/usr/doc/$PRGNAM-$VERSION
|
||||
CHROOT=$TMP/$PRGNAM
|
||||
DO_CONFIG=${DO_CONFIG:-yes}
|
||||
MAILDIR=${MAILDIR:-no}
|
||||
SYMLINK_SERVICE=${SYMLINK_SERVICE:-no}
|
||||
ADMIN_USER=${ADMIN_USER:-nobody}
|
||||
INSTALL_USERS=${INSTALL_USERS:-yes}
|
||||
VERBOSE_ADDCHROOT=${VERBOSE_ADDCHROOT:-yes}
|
||||
export VERBOSE_ADDCHROOT
|
||||
|
||||
# Put here rather than /var/log/setup to keep different build variants
|
||||
INSTDIR=$DOCDIR/install_scripts
|
||||
|
||||
[ "$ARCH" = "x86_64" ] && LIBDIRSUFFIX="64" || LIBDIRSUFFIX=""
|
||||
|
||||
# These are the user and group ids allocated by SBo
|
||||
NOFILES_GROUP=${NOFILES_GROUP:-340}
|
||||
QMAIL_GROUP=${QMAIL_GROUP:-339}
|
||||
ALIAS_USER=${ALIAS_USER:-339}
|
||||
QMAILD_USER=${QMAILD_USER:-340}
|
||||
QMAILL_USER=${QMAILL_USER:-341}
|
||||
QMAILP_USER=${QMAILP_USER:-342}
|
||||
QMAILQ_USER=${QMAILQ_USER:-343}
|
||||
QMAILR_USER=${QMAILR_USER:-344}
|
||||
QMAILS_USER=${QMAILS_USER:-345}
|
||||
|
||||
# It's an error to request to start qmail w/out specifying an admin user
|
||||
[ $SYMLINK_SERVICE = no -o $ADMIN_USER != nobody ] ||
|
||||
{ echo "You must provide an admin user to start qmail"; exit 1; }
|
||||
|
||||
# If any users or groups are already configured, use their id instead
|
||||
for i in nofiles qmail
|
||||
do
|
||||
grep -q ^$i: /etc/group &&
|
||||
eval $(echo $i|tr a-z A-Z)_GROUP=$(grep ^$i: /etc/group|cut -f3 -d:)
|
||||
done
|
||||
for i in alias qmail{d,l,p,q,r,s}
|
||||
do
|
||||
grep -q ^$i: /etc/passwd &&
|
||||
eval $(echo $i|tr a-z A-Z)_USER=$(grep ^$i: /etc/passwd|cut -f3 -d:)
|
||||
done
|
||||
|
||||
set -e
|
||||
|
||||
rm -rf $PKG $CHROOT
|
||||
mkdir -p $INSTDIR $OUTPUT $CHROOT
|
||||
|
||||
# Create doinst.sh fragment to add users & groups
|
||||
# (-r option stops creation of mailboxes)
|
||||
if [ "$INSTALL_USERS" = yes ]; then
|
||||
cat >$INSTDIR/doinst_users <<////
|
||||
grep -q ^nofiles: /etc/group ||
|
||||
groupadd -g $NOFILES_GROUP nofiles
|
||||
grep -q ^alias: /etc/passwd ||
|
||||
useradd -r -g nofiles -d /var/qmail/alias -u $ALIAS_USER -s "" alias
|
||||
grep -q ^qmaild: /etc/passwd ||
|
||||
useradd -r -g nofiles -d /var/qmail -u $QMAILD_USER -s "" qmaild
|
||||
grep -q ^qmaill: /etc/passwd ||
|
||||
useradd -r -g nofiles -d /var/qmail -u $QMAILL_USER -s "" qmaill
|
||||
grep -q ^qmailp: /etc/passwd ||
|
||||
useradd -r -g nofiles -d /var/qmail -u $QMAILP_USER -s "" qmailp
|
||||
grep -q ^qmail: /etc/group ||
|
||||
groupadd -g $QMAIL_GROUP qmail
|
||||
grep -q ^qmailq: /etc/passwd ||
|
||||
useradd -r -g qmail -d /var/qmail -u $QMAILQ_USER -s "" qmailq
|
||||
grep -q ^qmailr: /etc/passwd ||
|
||||
useradd -r -g qmail -d /var/qmail -u $QMAILR_USER -s "" qmailr
|
||||
grep -q ^qmails: /etc/passwd ||
|
||||
useradd -r -g qmail -d /var/qmail -u $QMAILS_USER -s "" qmails
|
||||
////
|
||||
else
|
||||
cat /dev/null >$INSTDIR/doinst_users
|
||||
fi
|
||||
|
||||
cd $CHROOT
|
||||
rm -rf $PRGNAM-$VERSION
|
||||
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
||||
cd $PRGNAM-$VERSION
|
||||
chown -R root:root .
|
||||
find -L . \
|
||||
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
||||
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
||||
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
||||
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
||||
|
||||
for i in $CWD/*.patch
|
||||
do
|
||||
cat $i|patch -p0
|
||||
done
|
||||
|
||||
############################################################################
|
||||
# The build process requires all the qmail users to be registered, #
|
||||
# so do it in a chroot to avoid messing with the build system's etc/passwd #
|
||||
############################################################################
|
||||
|
||||
cd $CHROOT
|
||||
export MKCHROOT_FOR_GCC=yes
|
||||
mkchroot .
|
||||
|
||||
# need make + groff + sed
|
||||
addchroot . make guile gc libffi libunistring groff sed
|
||||
|
||||
# need gcc, kernel headers, flex
|
||||
addchroot . binutils gcc libmpc kernel-headers flex
|
||||
|
||||
mkdir -p var/qmail
|
||||
|
||||
# install the qmail users and groups for chroot
|
||||
cat >>etc/group <<////
|
||||
nofiles:x:$NOFILES_GROUP:
|
||||
qmail:x:$QMAIL_GROUP:
|
||||
////
|
||||
cat >>etc/passwd <<////
|
||||
root:x:0:0::/root:/bin/bash
|
||||
alias:x:$ALIAS_USER:$NOFILES_GROUP::/var/qmail/alias:/bin/true
|
||||
qmaild:x:$QMAILD_USER:$NOFILES_GROUP::/var/qmail:/bin/true
|
||||
qmaill:x:$QMAILL_USER:$NOFILES_GROUP::/var/qmail:/bin/true
|
||||
qmailp:x:$QMAILP_USER:$NOFILES_GROUP::/var/qmail:/bin/true
|
||||
qmailq:x:$QMAILQ_USER:$QMAIL_GROUP::/var/qmail:/bin/true
|
||||
qmailr:x:$QMAILR_USER:$QMAIL_GROUP::/var/qmail:/bin/true
|
||||
qmails:x:$QMAILS_USER:$QMAIL_GROUP::/var/qmail:/bin/true
|
||||
////
|
||||
|
||||
# Set up the commands to run in the chroot jail
|
||||
cat >commands <<////
|
||||
cd /$PRGNAM-$VERSION
|
||||
make
|
||||
make setup check
|
||||
////
|
||||
|
||||
# Run the chroot commands
|
||||
chroot . /bin/sh /commands
|
||||
|
||||
rm -r var/qmail/man/cat*
|
||||
mv var/qmail/doc/* $DOCDIR
|
||||
rmdir var/qmail/doc
|
||||
mv var/qmail/man $PKG/usr
|
||||
mv var $PKG
|
||||
|
||||
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
||||
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
||||
|
||||
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
||||
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
||||
|
||||
cat $CWD/$PRGNAM.SlackBuild > $DOCDIR/$PRGNAM.SlackBuild
|
||||
cp -a $CHROOT/$PRGNAM-$VERSION/{BLURB*,CHANGES,COPYRIGHT,INTERNALS,README} $DOCDIR
|
||||
|
||||
chown -R root: $PKG/usr
|
||||
|
||||
mkdir -p $PKG/install
|
||||
cat $INSTDIR/doinst_users $CWD/doinst_new > $INSTDIR/doinst_sh
|
||||
|
||||
###########################################################################
|
||||
# doinst.sh implements the configure advice in "Life with qmail" (LWQ). #
|
||||
# You can skip this step by secifying DO_CONFIG=no on the SlackBuild line #
|
||||
###########################################################################
|
||||
|
||||
if [ $DO_CONFIG = yes ]
|
||||
then
|
||||
# LWQ 2.5.5
|
||||
cd $CHROOT/$PRGNAM-$VERSION
|
||||
cp config hostname dnsfq dnsip ipmeprint dnsptr $INSTDIR
|
||||
cat $CWD/doinst_config >> $INSTDIR/doinst_sh
|
||||
|
||||
# LWQ 2.8.1
|
||||
cd $PKG
|
||||
cat $CWD/LWQ_scripts/rc > var/qmail/rc
|
||||
chmod 755 var/qmail/rc
|
||||
mkdir -p var/log/qmail
|
||||
[ "$MAILDIR" = no ] && i=./Mailbox || i=./Maildir/
|
||||
echo $i > var/qmail/control/defaultdelivery
|
||||
|
||||
# LWQ 2.8.2.1
|
||||
cat $CWD/LWQ_scripts/qmailctl-script-dt70 > var/qmail/bin/qmailctl
|
||||
chmod 755 var/qmail/bin/qmailctl
|
||||
cat $CWD/LWQ_scripts/inst_check > var/qmail/bin/inst_check
|
||||
chmod 755 var/qmail/bin/inst_check # LWQ 2.9
|
||||
mkdir usr/bin
|
||||
ln -s ../../var/qmail/bin/{qmailctl,inst_check} usr/bin
|
||||
|
||||
# LWQ 2.8.2.2
|
||||
mkdir -p var/qmail/supervise/qmail-send/log
|
||||
mkdir -p var/qmail/supervise/qmail-smtpd/log
|
||||
cat $CWD/LWQ_scripts/qmail-send-run > var/qmail/supervise/qmail-send/run
|
||||
cat $CWD/LWQ_scripts/qmail-send-log-run \
|
||||
> var/qmail/supervise/qmail-send/log/run
|
||||
cat $CWD/LWQ_scripts/qmail-smtpd-run > var/qmail/supervise/qmail-smtpd/run
|
||||
echo 20 > var/qmail/control/concurrencyincoming
|
||||
chmod 644 var/qmail/control/concurrencyincoming
|
||||
cat $CWD/LWQ_scripts/qmail-smtpd-log-run \
|
||||
> var/qmail/supervise/qmail-smtpd/log/run
|
||||
chmod 755 var/qmail/supervise/qmail-send/run
|
||||
chmod 755 var/qmail/supervise/qmail-send/log/run
|
||||
chmod 755 var/qmail/supervise/qmail-smtpd/run
|
||||
chmod 755 var/qmail/supervise/qmail-smtpd/log/run
|
||||
mkdir -p var/log/qmail/smtpd
|
||||
chown $QMAILL_USER:$NOFILES_GROUP var/log/qmail var/log/qmail/smtpd
|
||||
[ $SYMLINK_SERVICE = no ] || cat $CWD/doinst_service >> $INSTDIR/doinst_sh
|
||||
|
||||
# 2.8.3 is done in doinst_config
|
||||
|
||||
# LWQ 2.8.4
|
||||
if [ $ADMIN_USER != nobody ]
|
||||
then
|
||||
echo $ADMIN_USER > var/qmail/alias/.qmail-root
|
||||
echo $ADMIN_USER > var/qmail/alias/.qmail-postmaster
|
||||
ln -s .qmail-postmaster var/qmail/alias/.qmail-mailer-daemon
|
||||
ln -s .qmail-postmaster var/qmail/alias/.qmail-abuse
|
||||
chmod 644 var/qmail/alias/.qmail-root var/qmail/alias/.qmail-postmaster
|
||||
fi
|
||||
fi
|
||||
|
||||
# qmail installer likes to put a sendmail symlink in /usr/lib
|
||||
mkdir -p $PKG/usr/lib
|
||||
|
||||
# symlink useful programs to usr/bin
|
||||
mkdir -p $PKG/usr/bin
|
||||
ln -s ../../var/qmail/bin/maildirmake $PKG/usr/bin
|
||||
|
||||
# Distribute the installer test suite
|
||||
mkdir $INSTDIR/tests
|
||||
cp -a $CWD/tests/{README,makechroot} $INSTDIR/tests/
|
||||
chown -R root: $INSTDIR/tests
|
||||
|
||||
cat $CWD/slack-desc > $PKG/install/slack-desc
|
||||
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
||||
|
||||
cd $PKG
|
||||
/sbin/makepkg -l n -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|
|
@ -0,0 +1,10 @@
|
|||
PRGNAM="netqmail"
|
||||
VERSION="1.06"
|
||||
HOMEPAGE="http://qmail.ii.net/netqmail/"
|
||||
DOWNLOAD="http://qmail.ii.net/netqmail-1.06.tar.gz"
|
||||
MD5SUM="c922f776140b2c83043a6195901c67d3"
|
||||
DOWNLOAD_x86_64=""
|
||||
MD5SUM_x86_64=""
|
||||
REQUIRES="ucspi-tcp mkchroot"
|
||||
MAINTAINER="Duncan Roe"
|
||||
EMAIL="duncan_roe@optusnet.com.au"
|
|
@ -0,0 +1,19 @@
|
|||
# HOW TO EDIT THIS FILE:
|
||||
# The "handy ruler" below makes it easier to edit a package description.
|
||||
# Line up the first '|' above the ':' following the base package name, and
|
||||
# the '|' on the right side marks the last column you can put a character in.
|
||||
# You must make exactly 11 lines for the formatting to be correct. It's also
|
||||
# customary to leave one space after the ':' except on otherwise blank lines.
|
||||
|
||||
|-----handy-ruler------------------------------------------------------|
|
||||
netqmail: netqmail (the qmail MTA)
|
||||
netqmail:
|
||||
netqmail: netqmail is a source distribution of qmail 1.0.3. qmail is a secure,
|
||||
netqmail: reliable, efficient, simple message transfer agent. It is designed
|
||||
netqmail: for typical Internet-connected UNIX hosts. As of October 2001, qmail
|
||||
netqmail: was the second most common SMTP server on the Internet, and had by
|
||||
netqmail: far the fastest growth of any SMTP server. Nowadays its Internet
|
||||
netqmail: usage is about 10%.
|
||||
netqmail: qmail home page: http://qmail.ii.net/top.html
|
||||
netqmail: a gentler introduction: http://www.lifewithqmail.org/lwq.html
|
||||
netqmail:
|
|
@ -0,0 +1,31 @@
|
|||
makechroot
|
||||
|
||||
Make a chroot-able tree in which to run installpkg or explodepkg netqmail (i.e.
|
||||
from an interactive instance of chroot).
|
||||
Can also test installpkg --root to this tree.
|
||||
|
||||
Whatever you do, you can step through the script commands in a root window.
|
||||
After explodepkg, you can step through the install scripts.
|
||||
|
||||
See ../README.SBo for mkchroot caveats. Approximate disk usage: 1.5MB local
|
||||
$CHROOT, 131MB mounted $CHROOT.
|
||||
|
||||
Set CHROOT to dir to buid (will be removed & re-created) (default is /tmp/t5).
|
||||
Set PKGDIR to directory containing SBo packages (default is /usr/packages).
|
||||
Set STRIP_INITTAB_SV=no to leave the SV line added by daemontools (dflt yes).
|
||||
Set INSTALL_DAEMONTOOLS=yes to install daemontools (default is no).
|
||||
Set STRIP_QMAIL_USERS_GROUPS=no to retain qmail users and groups (dflt yes).
|
||||
Set VERBOSE_ADDCHROOT=false to suppress install progress reporting (dflt true).
|
||||
Set MKCHROOT_IGNORE_LN_ERRORS=yes to suppress error messages from mounted chroot
|
||||
|
||||
If you specified INSTALL_DAEMONTOOLS=yes, you can try running inst_check from an
|
||||
interactive chroot instance (qmail installation checker).
|
||||
inst_check will tell you to mount /proc - be sure to umount it afterwards.
|
||||
*if* the main system is running svscanboot, *and* the main system is not running
|
||||
an MTA, on re-running inst_check you should see
|
||||
|
||||
Congratulations, your LWQ installation looks good!
|
||||
|
||||
Otherwise you should see a self-explanatory error message. If the main system is
|
||||
not runninmg svscanboot, you can start it in the chroot environment.
|
||||
Remember to umount /proc before exitting chroot.
|
|
@ -0,0 +1,74 @@
|
|||
#!/bin/sh
|
||||
#set -x
|
||||
|
||||
# A function to make a file local (not hard-linked to the real file)
|
||||
# One should run this on any file that the test might modify
|
||||
make_local()
|
||||
{
|
||||
while [ $# -gt 0 ]
|
||||
do
|
||||
cp -a $CHROOT/$1 $CHROOT/$1.new
|
||||
mv $CHROOT/$1.new $CHROOT/$1
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
CHROOT=${CHROOT:-/tmp/t5}
|
||||
VERBOSE_ADDCHROOT=${VERBOSE_ADDCHROOT:-true}
|
||||
export VERBOSE_ADDCHROOT
|
||||
PKGDIR=${PKGDIR:-/usr/packages}
|
||||
[ -n "$MKCHROOT_IGNORE_LN_ERRORS" ] && LNE='2>/dev/null' || LNE=
|
||||
|
||||
# These are options
|
||||
INSTALL_DAEMONTOOLS=${INSTALL_DAEMONTOOLS:-no}
|
||||
STRIP_INITTAB_SV=${STRIP_INITTAB_SV:-yes}
|
||||
STRIP_QMAIL_USERS_GROUPS=${STRIP_QMAIL_USERS_GROUPS:-yes}
|
||||
|
||||
[ ! -d $CHROOT/proc/1 ] || umount $CHROOT/proc
|
||||
rm -rf $CHROOT
|
||||
mkchroot $CHROOT
|
||||
addchroot $CHROOT tar pkgtools
|
||||
mkdir -p $CHROOT$PKGDIR
|
||||
eval ln $PKGDIR/netqmail* $PKGDIR/daemontools* $CHROOT$PKGDIR $LNE \|\| \
|
||||
cp -a $PKGDIR/netqmail* $PKGDIR/daemontools* $CHROOT$PKGDIR
|
||||
addchroot $CHROOT ucspi-tcp mkchroot
|
||||
|
||||
# Set up Slackware install DB for mkchroot
|
||||
for i in packages scripts
|
||||
do
|
||||
mkdir $CHROOT/var/log/$i
|
||||
(cd /var/log/$i; ls -1 | while read j; do [ -d $j ] ||
|
||||
eval ln $j $CHROOT/var/log/$i $LNE \|\| cp -a $j $CHROOT/var/log/$i; done)
|
||||
done
|
||||
|
||||
addchroot $CHROOT etc
|
||||
make_local etc/{group,gshadow,passwd,shadow}
|
||||
addchroot $CHROOT sysvinit
|
||||
addchroot $CHROOT sysvinit-scripts
|
||||
make_local etc/inittab
|
||||
[ $STRIP_INITTAB_SV != yes ] ||
|
||||
{
|
||||
cat $CHROOT/etc/inittab | grep -E -v '^SV:' >$CHROOT/etc/inittab.new
|
||||
mv $CHROOT/etc/inittab.new $CHROOT/etc/inittab
|
||||
}
|
||||
addchroot $CHROOT sed util-linux gzip network-scripts shadow ncurses
|
||||
mkdir $CHROOT/root $CHROOT/proc
|
||||
[ $INSTALL_DAEMONTOOLS = no ] || addchroot $CHROOT daemontools
|
||||
|
||||
[ $STRIP_QMAIL_USERS_GROUPS != yes ] ||
|
||||
{
|
||||
mount -tproc proc $CHROOT/proc
|
||||
|
||||
for i in alias qmail{d,l,p,q,r,s}
|
||||
do
|
||||
grep -q ^$i: $CHROOT/etc/passwd && chroot $CHROOT userdel $i
|
||||
done
|
||||
for i in nofiles qmail
|
||||
do
|
||||
grep -q ^$i: $CHROOT/etc/group && chroot $CHROOT groupdel $i
|
||||
done
|
||||
umount $CHROOT/proc
|
||||
}
|
||||
|
||||
# inst_check needs these
|
||||
addchroot $CHROOT procps-ng gawk net-tools
|
|
@ -0,0 +1,10 @@
|
|||
useradd()
|
||||
{
|
||||
ADDED_USERS=$ADDED_USERS' '$(echo "$@"|rev|cut -f1 -d' '|rev)
|
||||
/usr/sbin/useradd "$@"
|
||||
}
|
||||
groupadd()
|
||||
{
|
||||
ADDED_GROUPS=$ADDED_GROUPS' '$(echo "$@"|rev|cut -f1 -d' '|rev)
|
||||
/usr/sbin/groupadd "$@"
|
||||
}
|
Loading…
Reference in New Issue