E-mail server ============= Technology ---------- Our mail server is installed on `mail1.pvt.confirm.ch `_ and is driven by: * `Postfix `_ as MTA * `Cyrus IMAP `_ MDA * `Postgrey `_ as greylisting filter * `SpamAssassin `_ as SPAM filter * `ClamAV `_ as anti virus engine * `Roundcube `_ as webmail client We're using an LDAP backend for virtual domains and mailboxes. Virtual domains --------------- Postfix needs to know its list of own domains. These domains are managed in the following LDAP DN: .. code-block:: none ou=domains,dc=confirm,dc=ch If you've a new domain which Postfix should serve just copy an existing one and update it accordingly. Virtual mailboxes ----------------- Of course Postfix also needs to know about the different mailboxes / mail addresses which it is in charge of. These mailboxes are also managed in the LDAP backend. The Base DN **for employees** is: .. code-block:: none ou=users,dc=confirm,dc=ch The Base DN **for non-employees** is: .. code-block:: none ou=vmail,dc=confirm,dc=ch The mail address of a user is defined in the ``mail`` attribute. This mail address is also the username for the login. However, you can easily add additional mail addresses by specyfing multiple ``mailAlternateAddress`` attributes. Cyrus mailboxes --------------- Since Cyrus 2.5 (Debian 9), the mailboxes should automatically be created on the first login. .. hint:: More about this can be found in the `Cyrus ansible role `_. cyradm ------ Connect to Cyrus via cyradm ~~~~~~~~~~~~~~~~~~~~~~~~~~~ If you want to manage mailboxes manually, login into `mail1.pvt.confirm.ch `_ and connect to Cyrus via ``cyradm``: .. code-block:: bash cyradm -u cyrus localhost .. hint:: The password is stored in the :ref:`Enpass ` vault. First steps ~~~~~~~~~~~ When logged in, you can enter ``help`` if you want to have an overview over the available commands. To list the mailboxes, you can run the following command: .. code:: lm The ``cyrus`` user is an admin user and can manage the whole Cyrus IMAP server. However, to manage specific mailboxes, you need to give the ``cyrus`` user access to those specific mailboxes first: .. code:: sam user..@confirm.ch cyrus all Rename mailbox ~~~~~~~~~~~~~~ The rename of a complete mailbox is a bit "tricky" and involves several steps: First you need to list all mailboxes via ``lm``, find the ones you're interested in renaming and then execute the following steps per mailbox: .. code:: # Give cyrus permissions to manage mailbox sam user..@confirm.ch cyrus all # Rename mailbox renm user..@confirm.ch user..@confirm.ch # Give new UID permissions sam user..@confirm.ch @confirm.ch all # Revoke permissions from old UID and cyrus sam user..@confirm.ch @confirm.ch none sam user..@confirm.ch cyrus none .. important:: In case the new top-level mailbox isn't existing, you need to create it first by executing ``cm user.@confirm.ch`` and ``sam user.@confirm.ch all``. While all subdirectories were moved automatically by Cyrus' ``renm`` command, you also need to move the files on the filesystem manually: .. code:: cd /var/spool/cyrus/mail/domain/c/confirm.ch/ mv /user//* /user//