openQmail

A modern mail transfer agent suite around eQmail

User Tools

Site Tools


Modules
eQmail


Installation

This document covers the installation of eQmail-1.11 and higher. There are some significant changes against prior versions. The old and outdated installation instructions could be found here.

Build the Sources

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 the tarball:

$> wget ftp://ftp.dyndn.es/eQmail-latest.tar.gz
$> tar -xvzf eqmail-*.tar.gz -C /usr/src
$> cd /usr/src/eQmail

Change into the folder with the extracted sources and edit  conf-build  to your needs if required. The most important setting is the first variable PKGDIR which specifies the installation folder. Usually all default values should be fine.

Optional edit  conf-cc  and  conf-ld  to add compiler options.

Still eQmail-1.11 requires that the qmail system users have to exists before compilation. The users can be created by using the script  mkusers . If it fails, it have to be done by hand. As example on a typical linux system do:

$> groupadd nofiles
$> useradd -g nofiles -d /usr/local/qmail/var/alias -s /sbin/nologin alias
$> useradd -g nofiles -d /usr/local/qmail -s /sbin/nologin qmaild
$> useradd -g nofiles -d /usr/local/qmail -s /sbin/nologin qmaill
$> useradd -g nofiles -d /usr/local/qmail -s /sbin/nologin qmailp
$> groupadd qmail
$> useradd -g qmail -d /usr/local/qmail -s /sbin/nologin qmailq
$> useradd -g qmail -d /usr/local/qmail -s /sbin/nologin qmailr
$> useradd -g qmail -d /usr/local/qmail -s /sbin/nologin qmails

These are the default users and groups. They have to have the same names as configured in  conf-build .

The home directories of the eqmail users have to be correct, otherwise I guaranty that you will run into trouble!

Build eQmail and install it:

$> make clean
$> make
$> make install

The install step does include a basic configuration (formerly config[-fast]). The step  make clean  is highly recommended.

Some folder names did change in eQmail-1.11 against prior versions and *qmail derivatives! Read the following carefully!

Inside the installation directory there are now 2 new folders  tmp  and  var . The folders  alias ,  queue  and  users   are now subfolders of  var . Most important:  control  was renamed to  etc . The format of (all) configuration files didn't change.

Now you should have anything in the qmail home directory. The subfolder  etc  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

First we have to create the required system aliases:

$> cd /usr/local/qmail/var/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 /usr/local/qmail/var/users
$> cat > assign <<EOF
=foo:foo:65534:65533:/usr/local/qmail/var/users/foo:::
.
EOF
$> ../bin/qmail-newu
$> mkdir foo
$> ../bin/maildirmake foo/.Maildir
$> chown -R 65534:65533 foo

Create the Services

Even if other ways are possible it is recommended to use  qmail-tcpsrv , which by itself is part of eQmail an updated fork of  tcpserver  from the ucspi-tcp-0.88 package. Thus a dependency to ucspi-tcp doesn't exists anymore except you want to use additional tools from this package.

Common usage is to run a *qmail installation under daemontools. This is still possible but no longer the preferred way of eQmail. For linux systems there are boot scripts available - please refer to the related documentation to learn how to use it with  qmail-tcpsrv . Or you can (or maybe have to) use  (x)inetd . One reason to not use damontools is that clamav 0.9x has an issue to write to stderr if running under daemontools. Another is that it isn't maintained at all.

After installing the boot scripts create a symlink like:

$ ln -s /usr/local/qmail/etc/bootctrl/eqmaild /etc/init.d/eqmail

Then a start/stop script for eQmail could be similar to the following:

#!/bin/sh
 
start() {
    /etc/init.d/eqmaild start
}
stop() {
    /etc/init.d/eqmaild stop
}
restart() ....
status() ...

However, the file  eqmaild  is like a boot script and starts all configured services.

Alternative: xinetd

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 ):

#!/bin/sh
 
conf() {
    DAEMON="qmail-send"
    pidfile="/var/run/qmail.pid"
    logger="/usr/local/qmail/bin/splogger"
}
 
start() {
    conf
    echo "Starting eQmail: ${DAEMON}"
    start-stop-daemon --quiet --start --pidfile "${pidfile}" -m --background \
        --exec env - PATH="/usr/local/qmail/bin:$PATH" \
        qmail-start "`cat /usr/local/qmail/etc/defaultdelivery`" ${logger} qmail
#    eend $?
}
 
stop() {
    conf
    echo "Stopping eQmail: ${DAEMON}"
    start-stop-daemon --quiet --stop --pidfile "${pidfile}"
#    eend $?

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    = 0.0.0.0
    only_from    = 0.0.0.0
    instances    = UNLIMITED
    log_type     = SYSLOG mail
    server       = /usr/local/qmail/bin/tcp-env
    server_args  = -R /usr/local/qmail/<boot>/qmail-xinetd
    env          = RELAYCLIENT=
}

Beware that you need a config file for each service (port) and separated for IPv4 and IPv6.

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

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

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

Test it

Now start your services. Test if all works fine with:

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

and

$ echo to: foo | /usr/local/qmail/bin/qmail-inject 
$
Last modified: 2018/10/29 07:41

Page Tools