Summary
Summary
Download qmail-1.01-?.src.rpm from ftp://ftp.engr.uark.edu/pub/qmail.
These instructions and details were written for the qmail-1.01-9.rpm, but they should be pretty much compatible with future releases.
Type :
# rpm -i qmail-1.01-9.src.rpm # rpm -bb /usr/src/redhat/SPECS/qmail-1.01-9.specYou should now see the binary qmail RPM being built. Now install the binary RPM.
# rpm -U /usr/src/redhat/RPMS/i386/qmail-1.01-9.i386.rpm(Non Intel users should change the i386 above to the appropriate directory for their architecture).
Now move the qmail sources to a safe place, since there are many patches available on www.qmail.org that you may wish to apply.
# mv /usr/src/redhat/BUILD/qmail-1.01 /usr/src/The qmail sources will now be in /usr/src/qmail-1.01.
Now is a good time to look at the changelog section of the rpm spec,
to see what has changed between versions, especially if you are using a
version of the rpm later than the qmail-1.01-9.src.rpm.
To do this type:
% more /usr/src/redhat/SPECS/qmail-1.01-?.specreplacing ? with the version number of your qmail rpm. Look for the section that starts with %changelog.
qmailp:*:86:80:qmail:/var/qmail:/bin/true qmaill:*:85:80:qmail:/var/qmail:/bin/true qmails:*:84:81:qmail:/var/qmail:/bin/true qmailr:*:83:81:qmail:/var/qmail:/bin/true qmailq:*:82:81:qmail:/var/qmail:/bin/true alias:*:81:80:qmail:/etc/qmail/alias:/bin/true qmaild:*:80:80:qmail:/var/qmail:/bin/trueYou should see that the following lines were added to /etc/group:
nofiles:*:80: qmail:*:81:These are the various users/groups that qmail will use.
# /var/qmail/bin/showctl | lessto see what your current qmail configuration is. Check that this information is correct. Read the qmail-control(5) man page for more information on each of the control files. I also suggest that you read the qmail-upgrade(7) and dot-qmail(5) man pages. Also read the qmail documentation project pages and www.qmail.org.
# /etc/rc.d/init.d/qmail startand you can stop it by running:
# /etc/rc.d/init.d/qmail stop
#smtp stream tcp nowait qmaild /usr/sbin/tcpd /var/qmail/bin/tcp-env /var/qmail/bin/qmail-smtpdRemove the # at the beginning of the line. Now, you need to give inetd a HUP so that it recognises this change. Type:
# killall -HUP inetdNow type:
# netstat -an | grep 25You should see something like:
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTENThis means that qmail-smtpd is now listening on port 25, the mail port.
./Mailboxwhich means that mail will get delivered to a file called Mailbox in each user's home directory. To use the Maildir mailbox format change this to:
./Maildir/(Please remember the trailing /).
Download the dot-forward package from ftp://koobera.math.uic.edu/pub/software/. The most recent version is dot-forward-0.70. Untar this and read the INSTALL file for info on how to install it.
Then insert the following as the first line of /var/qmail/control/dot-qmail:
|dot-forward .forwardSo, your /var/qmail/control/dot-qmail should read something like:
|dot-forward .forward ./Mailboxor
|dot-forward .forward ./Maildir/
If you want to have all the mail logs go to a single file then add the following lines to /etc/syslog.conf:
# Log all the mail messages in one place. mail.* /var/log/maillogperhaps under the entry for /var/log/messages.
The instructions are also really aimed at someone installing this qmail rpm for the first time. If you are upgrading, please take a look at the README file at:
ftp://moni.msci.memphis.edu/pub/qmailThe README file also gives information on using the rpm with NIS.
Download
Type :
# rpm --rebuild functions-2-1.src.rpm # rpm --rebuild daemontools-0.53-11.src.rpm # rpm --rebuild ucspi-tcp-0.80-12.src.rpm # rpm -U qmail-1.01-15ucspi.src.rpm # rpm -bb /usr/src/redhat/SPECS/qmail-1.01-ucspi.specYou should see the binary RPMs being built. Now install all the binary RPMs.
# rpm -U /usr/src/redhat/RPMS/i386/functions-2-1.i386.rpm # rpm -U /usr/src/redhat/RPMS/i386/daemontools-0.53-11.i386.rpm # rpm -U /usr/src/redhat/RPMS/i386/ucspi-tcp-0.80-12.i386.rpm # rpm -U /usr/src/redhat/RPMS/i386/qmail-1.01-15ucspi.i386.rpm(Note that these RPMs have only been tested on i386 Intel.)
Now move the qmail sources to a safe place, since there are many patches available on www.qmail.org that you may wish to apply.
# mv /usr/src/redhat/BUILD/qmail-1.01 /usr/src/The qmail sources will now be in /usr/src/qmail-1.01.
Remove unnecessary stuff left over.
# rm -f /usr/src/redhat/SOURCES/condredirect.diff # rm -f /usr/src/redhat/SOURCES/qmail* # rm -f /usr/src/redhat/RPMS/i386/functions-2-1.i386.rpm # rm -f /usr/src/redhat/RPMS/i386/daemontools-0.53-11.i386.rpm # rm -f /usr/src/redhat/RPMS/i386/ucspi-tcp-0.80-12.i386.rpm # rm -f /usr/src/redhat/RPMS/i386/qmail-1.01-15ucspi.i386.rpm
alias:!!:80:80::/var/qmail/alias:/bin/true qmaild:!!:81:80::/var/qmail:/bin/true qmaill:!!:82:80::/var/qmail:/bin/true qmailp:!!:83:80::/var/qmail:/bin/true qmailq:!!:84:81::/var/qmail:/bin/true qmailr:!!:85:81::/var/qmail:/bin/true qmails:!!:86:81::/var/qmail:/bin/trueYou should see that the following lines were added to /etc/group:
nofiles:x:80: qmail:x:81:These are the various users/groups that qmail will use.
# /var/qmail/bin/showctl | lessto see what your current qmail configuration is. Check that this information is correct. Read the qmail-control(5) man page for more information on each of the control files. I also suggest that you read the qmail-upgrade(7) and dot-qmail(5) man pages. Also read the qmail documentation project pages and www.qmail.org.
You use it as follows:
# /etc/rc.d/init.d/qmail.init paramwhere param is one of the commonly used paramterers described below.
Since qmail is run under tcpserver and supervise you have a secure, reliable, and easy way to manage running it.
The number of concurrent connections to your smtp port is specified by the variable CONCURRENT in /etc/rc.d/init.d/qmail-smtpd.init. Initially this is set to 40, but this can be changed by editing the file. Look for:
CONCURRENT=40 #number of concurrent connections
# (40 is the default of tcpserver)
near the beginning of the file.
The rules for who is allowed to connect to your smtp port are specified in /etc/tcprules.d/tcp.smtp. By default this file contains:
127.0.0.1:allow,RELAYCLIENT="" your.host's.ip.number,RELAYCLIENT=""This means that only local user's can use your mail port to relay mail. Read the tcprules(1) man page for information on setting up your rules.
Usually aliasempty contains the name of the default mailbox, but it can also contain programs to run, such as the dot-forward program to handle .forward files under qmail.
Using this rpm, the aliasempty options are specified in the script /etc/rc.d/init.d/qmail.init. Look for the line that says:
supervise $DIR qmail-start ./Mailbox accustamp qmail \ | setuser $LOGUSER supervise $DIR-cyclog cyclog $LOGDIR &If you want your default mailbox to be Mailbox in each users home directory then the default is correct.
If you want your default mailbox to be Maildir/ in each users home directory then change the ./Mailbox after qmail-start to ./Maildir/.
Note: remember the trailing / when using maildir.
Download the dot-forward package from ftp://koobera.math.uic.edu/pub/software/. The most recent version is dot-forward-0.70. Untar this and read the INSTALL file for info on how to install it.
Then put it as the first aliasempty line.
So, your /etc/rc.d/init.d/qmail.init have something like:
supervise $DIR qmail-start '|dot-forward .forward ./Mailbox' accustamp qmail \ | setuser $LOGUSER supervise $DIR-cyclog cyclog $LOGDIR &or
supervise $DIR qmail-start '|dot-forward .forward ./Maildir/' accustamp qmail \ | setuser $LOGUSER supervise $DIR-cyclog cyclog $LOGDIR &Note that it is important that you make it look exactly like the above.
qmail-send's activity is logged in /var/log/qmail/. In this directory you will see a list of files like:
-rw-r--r-- 1 qmaill 50 May 4 14:23 @00000894284589 -rw-r--r-- 1 qmaill 50 May 4 14:24 @00000894284605 -rw-r--r-- 1 qmaill 50 May 4 14:25 @00000894284667 -rw-r--r-- 1 qmaill 8624 May 4 16:11 @00000894284713 -rw-r--r-- 1 qmaill 2732 May 4 16:48 @00000894292111 -rw-r--r-- 1 qmaill 1391 May 4 16:56 @00000894293336 -rw-r--r-- 1 qmaill 978 May 4 17:02 @00000894293781 -rw-r--r-- 1 qmaill 2703 May 4 17:18 @00000894294183 -rw-r--r-- 1 qmaill 515 May 4 19:16 @00000894301208 -rw-r--r-- 1 qmaill 5387 May 4 20:05 @00000894302177The name of a log file is the TAI timestamp when the file was started. You can convert from TAI to your local date/time format using tailocal. See tailocal(1).
You can see what is happening in the current logfile by typing:
% tail -f `ls -trc /var/log/qmail | tail -1`It might be useful to put this in a script to avoid having to retype it.
Similarly, qmail-smtpd's activity is logged in /var/log/qmail-smtpd/.
For more information on cyclog, take a look at the cyclog(1) man page.