Installing Mailman3 on Ubuntu 18.04 was surprisingly difficult, that's why I want to share my experiences with the world. Here you are:
apt install mariadb-server
Add to [mysqld]
in /etc/mysql/mariadb.conf.d/50-server.cnf
:
innodb_file_format = Barracuda
innodb_default_row_format = dynamic
innodb_file_per_table = 1
innodb_large_prefix = 1
Restart MariaDB:
systemctl restart mariadb
Grant database access rights:
mysql -uroot
grant all privileges on mailman3.* to mailman3@localhost identified by 'securepassword';
grant all privileges on mailman3web.* to mailman3@localhost identified by 'securepassword';
apt install mailman3-full dbconfig-mysql python-pymysql python3-pymysql
- Configure mailman3 and mailman3-web:
- Configure database with dbconfig-common -> yes
- MySQL application password: securepassword
- Connection method: Unix socket
- Database name: mailman3
- Mysql username: mailman3@localhost
- Mysql administrative user: root
- Add HyperKitty: Yes
Add the following lines to /etc/postfix/main.cf
:
transport_maps = hash:/var/lib/mailman3/data/postfix_lmtp
local_recipient_maps = hash:/var/lib/mailman3/data/postfix_lmtp
relay_domains = hash:/var/lib/mailman3/data/postfix_domains
Restart postfix:
systemctl restart postfix
apt install apache2
ln -s /etc/mailman3/apache.conf /etc/apache2/conf-enabled/mailman3.conf
a2enmod proxy_uwsgi
systemctl restart apache2
- In a browser, open http://localhost/mailman3
- Create a new user (admin)
- Hopefully receive the confirmation email, open the link (you might need to replace
https://localhost
byhttp://localhost
).
As the newly created user is not an admin user, use the MySQL database to give administration rights:
mysql -uroot mailman3web
update auth_user set is_superuser=true, is_staff=true where username='admin';
- Now, you should be able to configure domains and mailinglists in the web frontend.
- Visit http://localhost/mailman3/admin for the administration backend
Edit /etc/mailman3/mailman-web.py
, add the following lines:
AUTH_LDAP_SERVER_URI = "ldap://ldap.example.com"
AUTH_LDAP_USER_DN_TEMPLATE = "uid=%(user)s,ou=people,dc=example,dc=com"
AUTH_LDAP_BIND_DN = ""
AUTH_LDAP_BIND_PASSWORD = ""
AUTH_LDAP_USER_ATTR_MAP = {"first_name": "givenName", "last_name": "sn", "email": "mail"}
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
'django_auth_ldap.backend.LDAPBackend',
)
Install & Restart:
apt install python-django-auth-ldap
systemctl restart mailman3-web
-
If you want to disable the Fedora login button, uncomment the line
'django_mailman3.lib.auth.fedora'
of theINSTALLED_APPS
parameter in/etc/mailman3/mailman-web.conf
. -
If you want to disable sign-up, add the following lines to
/etc/mailman3/mailman-web.conf
(TODO: this still shows a 'Sign up' link and will produce a 500 Internal Server Error on click; didn't find a disable yet).
ACCOUNT_FORMS = {
'signup': False
}
-
If you want to disable email verification (we can assume that email addresses in LDAP are correct), add
ACCOUNT_EMAIL_VERIFICATION = 'none'
to/etc/mailman3/mailman-web.conf
. -
Further options: https://django-allauth.readthedocs.io/en/latest/configuration.html