D. J. Bernstein
Internet mail
qmail

Installing mini-qmail

A mini-qmail installation doesn't have a mail queue. Instead it gives each new message to a central server through QMQP.

There are three standard applications of mini-qmail:

How do I set up a QMQP server?

Here's how to set up a central server to offer QMQP service to authorized client hosts.

qmail 1.03 includes a QMQP server, qmail-qmqpd. You also need to have tcpserver installed.

First create /etc/qmqp.tcp in tcprules format to allow queueing from the authorized hosts. Make sure to deny connections from unauthorized hosts. For example, if queueing is allowed from 1.2.3.*:

     1.2.3.:allow
     :deny
Then create /etc/qmqp.cdb:
     tcprules /etc/qmqp.cdb /etc/qmqp.tmp < /etc/qmqp.tcp
You can change /etc/qmqp.tcp and run tcprules again at any time. Finally run qmail-qmqpd from your boot scripts:
     tcpserver -x /etc/qmqp.cdb -u 7770 -g 2108 0 628 qmail-qmqpd &
Replace 7770 and 2108 with the qmaild uid and the nofiles gid, and make sure that $PATH is set appropriately. 628 is the TCP port for QMQP.

How do I install mini-qmail?

A mini-qmail installation is just like a qmail installation, except that it's much easier to set up: Here's what you do need: Everything can be shared across hosts except for /var/qmail/control/idhost.

Remember that users won't be able to send mail if all the QMQP servers are down. Most sites have two or three independent QMQP servers.

Note that users can still use all the qmail-inject environment variables to control the appearance of their outgoing messages.

What about firewalls?

You won't need most of the mini-qmail programs on a firewall, but you will need qmail-smtpd to accept messages through SMTP. You can survive with a tiny configuration: You don't need to worry about setting up redundant QMQP servers here. If the internal gateway is down, qmail-smtpd will temporarily reject the message, and the remote client will automatically try again later.

What about mailing lists?

Here's how to set up ezmlm to send messages to a smarthost through QMQP:
  1. Create a /var/mini-qmail directory.
  2. Create a /var/mini-qmail/bin directory.
  3. Make a symbolic link to /var/qmail/bin/qmail-qmqpc from /var/mini-qmail/bin/qmail-queue.
  4. Put the smarthost's IP address into /var/qmail/control/qmqpservers.
  5. Compile and install ezmlm with /var/mini-qmail in conf-qmail.
You don't need to worry about setting up redundant QMQP servers here. If the smarthost is down, the message will stay in the local qmail queue and will be retried later.