Mailman: Difference between revisions

imported>Benley
first draft (more to come)
 
imported>Benley
Add most of the procedure to get it working
Line 1: Line 1:
== Running Mailman on NixOS ==
Requires at least NixOS 20.03; the <code>services.mailman</code> module in NixOS 19.09 is insufficient.
Requires at least NixOS 20.03; the <code>services.mailman</code> module in NixOS 19.09 is insufficient.


Line 7: Line 10:
* letsencrypt to acquire TLS certificates for nginx
* letsencrypt to acquire TLS certificates for nginx


==== configuration.nix ====
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
{ config, pkgs, ... }:
{ config, pkgs, ... }:
Line 87: Line 91:
}
}
</syntaxhighlight>
</syntaxhighlight>
=== Deployment steps ===
* Install and start the services:
<span style="color: red">[root@mailman:~]#</span> '''nixos-rebuild switch'''
* Generate initial <code>postfix_domains.db</code> and <code>postfix_lmtp.db</code> databases for Postfix:
<span style="color: red">[root@mailman:~]#</span> '''sudo -u mailman mailman aliases'''
* Create a django superuser account.  Be careful to run this only as the <code>uwsgi</code> user in <code>/var/lib/mailman-web</code> or you will run into permission problems later.
<span style="color: red">[root@mailman:~]#</span> '''cd /var/lib/mailman-web'''
<span style="color: red">[root@mailman:/var/lib/mailman-web]#</span> '''sudo -u uwsgi mailman-web createsuperuser'''
### Using settings module from /etc/mailman3/settings.py  ####
Username (leave blank to use 'uwsgi'): '''root'''
Email address: '''postmaster@example.com'''
Password:
Password (again):
Superuser created successfully.
* Navigate to <code>https://<your_mailman_hostname>/admin</code> in a web browser and login to the Django admin interface:
*:[[File:Django_admin_login.png|400px]]
* Navigate to <code>https://<your_mailman_hostname>/admin/sites/site</code>.  Click on the '''example.com''' site, change it to your desired domain name, and hit Save.  This configures the web serving domain, ''not'' the domain used for email.
* Navigate to <code>https://<your_mailman_hostname>/postorius/domains/new/</code>.  Fill in the form to add the domain you wish to use for mailing list email addresses.
*:[[File:Postorius_add_new_domain.png|425px]]