This Mailman 3 extension enables single-sign-on and list membership synchronisation with [uffd](https://git.cccv.de/uffd/uffd), using [uffd-ldapd](https://git.cccv.de/uffd/uffd-ldapd) and [uffd-nginxauth](https://git.cccv.de/uffd/uffd-nginxauth/).
User accounts and mailing list memberships are periodically synchronised with uffd group membership. Authentication is handled using Django's `PersistentRemoteUserMiddleware`, which only requires the login URLs to be proxied through the authentication proxy.
The CCCV [ansible role](https://git.cccv.de/infra/ansible/roles/mailman/) may also be helpful when configuring this.
## Installing
These examples assume that Mailman 3, uffd-ldapd, and uffd-nginxauth are installed as Debian packages. You should have a basic working Mailman 3 setup before attempting to install this. Nginx should be used as the reverse proxy, and uffd-ldapd and uffd-nginxauth should be installed and configured.
The `python3-django-auth-ldap` package should also be installed from apt.
This `postorius_ldap_membership_management` package needs to be accessible by the Mailman installation. This is (currently) possible by checking out the git repo and running the following command as root to install it in the global python packages:
```
# python3 ./setup.py install
```
## Configuration
We assume your HTTP hostname is `lists.example.org` and your uffd-ldapd DN is set to `dc=example,dc=org`.
### Nginx Configuration
This should probably be in `/etc/nginx/sites-enabled/lists.example.org.conf`:
# Set session expiry and disable account email verification
SESSION_EXPIRE_SECONDS=3600
ACCOUNT_EMAIL_VERIFICATION='none'
```
Now we configure the LDAP settings in the same file. These configuration options are from the [django-auth-ldap](https://django-auth-ldap.readthedocs.io) module.
In this example, `list_users` is the uffd group which allows access to the mailing list interface, and `list_admin` provides Mailman admin privileges:
At this point, the periodic jobs can be set up. These two commands should be run periodically:
```
/usr/bin/mailman-web syncldapusers
/usr/bin/mailman-web syncldapmemberships
```
# Configuring Mailing List Membership
Now we can configure synchronisation of mailing list membership. Note that the mailing list must be created in the Mailman web interface first.
This is also configured in `mailman-web.py`. In this example, the list `mygroup@lists.example.org` is configured. Members of `mygroup` are added as members of the list, `mygroup_moderators` are moderators and `mygroup_owners` are owners.