A modern mail transfer agent suite around eQmail

User Tools

Site Tools




Build the Sources

eQmail doesn't have a different install process than (net)qmail. Nevertheless there were be used some values:

  • home dir is  /var/qmail , since eQmail-1.10  /var/local/qmail 
  • non-root mail user name is  foo 

Replace these values with yours if necessary. It is recommended to use the user mechanism of qmail always, even if an equivalent system user exists.

Download sources and extract it:

$> wget
$> tar -xvzf eqmail-1.09.tar.gz -C /usr/src
$> cd /usr/src/eqmail-1.09

Edit the conf-* files to your needs. Each of these files has a description in it. The file  conf-qmail  defines the home directory (default: /var/qmail).

Create the necessary users - optional use the script  mkusers  to do this. If the script fails, it have to be done by hand. As example on a typical linux system do:

$> groupadd nofiles
$> useradd -g nofiles -d /var/qmail/alias alias
$> useradd -g nofiles -d /var/qmail qmaild
$> useradd -g nofiles -d /var/qmail qmaill
$> useradd -g nofiles -d /var/qmail qmailp
$> groupadd qmail
$> useradd -g qmail -d /var/qmail qmailq
$> useradd -g qmail -d /var/qmail qmailr
$> useradd -g qmail -d /var/qmail qmails

These are the default users and groups. They are configured in  conf-users  and  conf-groups  . These names have to match with the created ones. The  mkusers  script uses the values from the conf files. The qmail users and groups have to exists, otherwise eQmail will not compile!

Build and do basic configuration:

$> make
$> make setup check
$> ./config-fast <fqdn>

The  <fqdn>  parameter is optional. If not given it will be tried to get the fqdn from  hostname -f  .

Caveat: the alternative tool  config  may not work properly always. It is still the same as in (net)qmail. This will be changed in a later version of eQmail.

Now you should have anything in the qmail home directory. The subfolder  control  contains the config files:

  • me
  • defaultdomain
  • locals
  • rcpthosts
  • plusdomain
  • beforemote
  • smtpplugins

To make sure they have valid values, check at least the first four of these files.

Create Users and Aliases

Create the recommended system aliases:

$> cd /var/qmail/alias
$> echo foo > .qmail-root
$> echo root > .qmail-postmaster
$> ln -s .qmail-postmaster .qmail-mailer-daemon
$> ln -s .qmail-postmaster .qmail-abuse
$> chmod 644 .*

By using qmail users create the qmail user foo. The used ID's 65534:65533 are nobody and nogroup:

$> cd /var/qmail/users
$> cat > assign <<EOF
$> ../bin/qmail-newu
$> mkdir foo
$> ../bin/maildirmake foo/.Maildir
$> chown -R 65534:65533 foo

Create the Services

There are several ways to do this. The most common method is to use uscpi-tcp and daemontools. There is a lot of documentation out which describes how to do this. eQmail doesn't differ on such a setup from (net)qmail. A good starting point is LWQ.

Alternative xinetd can be used. There are at least to points to prefer it:

  • clamav 0.9x has an issue to write to stderr if running under daemontools
  • xinetd provides IPv6 by default, instead ucspi-tcp needs to be patched

First we create the startup script for qmail-start. In the example below the start-stop-daemon will be used. The benefit is that a pidfile will be created and the service will run in the background. Create a file (e.g.  /etc/{rc.d,init.d}/eqmaild  ):

conf() {
start() {
    echo "Starting eQmail: ${DAEMON}"
    start-stop-daemon --quiet --start --pidfile "${pidfile}" -m --background \
        --exec env - PATH="/var/qmail/bin:$PATH" \
        qmail-start "`cat /var/qmail/control/defaultdelivery`" ${logger} qmail
#    eend $?
stop() {
    echo "Stopping eQmail: ${DAEMON}"
    start-stop-daemon --quiet --stop --pidfile "${pidfile}"
#    eend $?

This could be an example only. Refer to the system documentation how to run a service at boot time.

Now we have to make listen the smtp daemon on a network port. Create a config file for xinetd, e.g.  /etc/xinetd.d/smtp-service  :

service smtp
    disable      = no
    id           = smtp
    flags        = NAMEINARGS IPv4
    socket_type  = stream
    protocol     = tcp
    wait         = no
    user         = qmaild
    group        = qmail
    interface    =
    only_from    =
    instances    = UNLIMITED
    log_type     = SYSLOG mail
    server       = /var/qmail/bin/tcp-env
    server_args  = -R /var/qmail/boot/qmail-xinetd
    env          = RELAYCLIENT=

The option server args contains the “run” file which will be invoked to start  qmail-smtpd . It calls here  /var/qmail/boot/qmail-xinetd  and looks like:

exec 3>&1
/var/qmail/bin/qmail-smtpd /var/qmail/qmail-pwrap 2>&1 1>&3 3>&- | /var/qmail/bin/splogger xinetd-smtpd 2 3>&-
exec 3>&-

The redirections of the file descriptor are necessary with xinetd - beware of it.

Now execute  eqmaild  and  xinetd . Test if all works fine with:

$ telnet localhost 25
Connected to localhost.
Escape character is '^]'.
220 <hostname> ESMTP


$ echo to: foo | /var/qmail/bin/qmail-inject 


Last modified: 2019/04/08 09:41

Page Tools