mailadm system integration files
================================

This README was generated by `mailadm {args}` and contains a complete
description of how you can get mailadm integrated with postfix,
dovecot, nginx and systemd. The instructions here have been tested
with an Ubuntu 16.04 and Debian 9 system. Other distributions or configurations
need adaptation.

Development of `mailadm` takes place on:

    https://github.com/deltachat/mailadm

Both mailadm web, prune and command line tools execute as the user
`mailadm` and do not require root privileges. However, `mailadm`
needs write permission to `{vmail_homedir}/{mail_domain}` sub directories.
It is advised to perform this operation::

    sudo chmod -R g+rwS {vmail_homedir}/{mail_domain}

and make sure that the `{mailadm_user}` is a member of the `{vmail_user}` group.


Integration with dovecot
------------------------------

Default location: `{dovecot_conf_d}/10-auth.conf`

To enable mailadm-controlled authentication and mail delivery services,
add the following line to the `{dovecot_conf_d}/10-auth.conf` file:

    !include auth-mailadm.conf.ext


With all dovecot related integration files in place
you can test the mailadm integration (as root)::

    # systemctl reload dovecot
    # systemctl status dovecot


Integration with postfix
------------------------

Perequisite: You need to already have configured a working "virtual mailbox" setup with postfix.

To let postfix know about mailadm-managed virtual users, add the
mailadm-generated `postfix-users` file to postfix configuration::

    # add these lines into your existing `{postfix_maincf}`
    virtual_mailbox_maps =
        hash:{path_virtual_mailboxes}

Note that mailadm will regenerate `{path_virtual_mailboxes}` when
users are added or deleted through the command line or web API.


Integration with nginx
----------------------

You need to add the following directies to an enabled domain,
for example `{nginx_sites_enabled}/default`::

    # add these lines to domain file in `{nginx_sites_enabled}`
    location {web_path} {{
        proxy_pass http://localhost:{localhost_web_port}/
    }}

This makes nginx proxy external web requests to our `mailadm-web` service.

