A qmail QMTP service handles incomming QMTP connections. It runs qmail-qmtpd under tcpserver and uses multilog to store log messages. Both tcpserver and multilog are supervised.
Install daemontools 0.70 or above. The following instructions assume that your boot scripts are already running svscan in a /service directory.
Install ucspi-tcp 0.86 or above.
Install and configure qmail 1.03. Installing qmail means creating the /var/qmail directory tree. Configuring qmail means setting up some basic control files in /var/qmail/control, setting up some basic aliases in /var/qmail/alias, and setting up /var/qmail/rc. If you have followed the instructions in INSTALL from the beginning through step 8, you must have done all these things.
The following instructions assume that any process is currently not listening on the TCP port 209, the standard QMTP port. If some process is currently listening on the TCP port 209, you have to stop that process or have that process not listen on the port before going any further. Here is a (probably incomplete) check list:
If you are running inetd and /etc/inetd.conf contains a line that starts with qmtp, comment out that line and give inetd a HUP signal.
If you are running qmail-qmtpd under tcpserver, give that tcpserver a TERM signal and comment out the tcpserver invocation in your system boot scripts.
You should have already set up a qmail delivery service. If you haven't, mail messages received via QMTP will be left in the queue without being delivered anywhere.
You will have to make three decisions:
The qmail daemon account name, normally qmaild. The tcpserver program and the qmail-qmtpd program run under this account. If this account does not exist, create it now.
The qmail log account name, normally qmaill. Logging programs run under this account. If this account does not exist, create it now.
The qmail QMTP service directory, normally /var/qmail/service/qmtpd. This is where logs and a few configuration files are stored.
Create the service directory by running the qmail-qmtpd-conf program:
qmail-qmtpd-conf qmaild qmaill /var/qmail/service/qmtpd
Change directory to the service directory:
cd /var/qmail/service/qmtpd
Optionally, if you want to allow relaying from selected clients through the service, add lines to tcp allowing connections and setting the RELAYCLIENT environment variable for the selected clients. For example, if you want to allow relaying from 127.0.0.1 and 192.168.1.*, add
127.0.0.1:allow,RELAYCLIENT="" 192.168.1.:allow,RELAYCLIENT=""
to tcp. You can do this by running the add-relayclient script:
./add-relayclient 127.0.0.1 192.168.1.
Compile tcp into a binary format for tcpserver:
make
(You have to run make in the service directory whenever you update tcp.)
Tell svscan about the new service:
ln -s /var/qmail/service/qmtpd /service
svscan will start the service within five seconds.
Check the service status:
svstat /service/qmtpd /service/qmtpd/log
The output should look something like:
/service/qmtpd: up (pid 6345) 6 seconds /service/qmtpd/log: up (pid 6347) 6 seconds
Run svstat several times and make sure that the process IDs shown do not change.
Check the log messages:
tail -f /service/qmtpd/log/main/current | tai64nlocal
The directory /service/qmtpd/log/main contains log files to which tcpserver (and possibly its children) stores the log messages. The output should look something like:
tcpserver: status: 0/40
Use ps to browse the process tree. It should contain the following portion:
svscan /service supervise qmtpd /usr/local/bin/tcpserver -vDUHR -lyour.host -xtcp.cdb -- 0 209 ... supervise log multilog t ./main
Two new supervise processes should have been added as svscan's children, one for tcpserver (running as qmaild) and the other for multilog (running as qmaill). The process IDs of tcpserver and multilog should match with svstat's output. All these processes should be idle at this time.