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

This README was generated by `mailadm {args}` and contains a
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


Processes and permissions
-------------------------------------------

- systemd mailadm-web executes as user `{mailadm_user}`, serving
  the web interface which is exposed through nginx (see below)

- systemd mailadm-prune executes as group and user `{vmail_user}`
  and removes users along with their home directory

- the `{path_mailadm_db}` database is writeable by the group `{vmail_user}`


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.

