From ArchWiki
Jump to navigation Jump to search

Postorius is a Django based management interface for Mailman.


To use Postorius, a working web server setup is required (e.g. using Apache HTTP Server to forward to the WSGI directly, or using Nginx forwarding requests to an application server such as UWSGI).

Install the postorius package.

Warning: Postorius should only be accessed over TLS (unless only accessed directly from the machine running it for testing purposes), as it otherwise exposes passwords and user data to the network.


The web application is configured in /etc/webapps/postorius/ which is included by the default configuration in /usr/share/webapps/postorius/

Note: Postorius should store user sensitive data (e.g. sqlite database) in /var/lib/postorius/data/, as that directory is only accessible by root and the application itself.

Change the default secret for the application:

SECRET_KEY = 'something-very-secret'

Make sure to disable debugging when running in production:

DEBUG = False

Add a valid email configuration (so that the Django application can verify subscribers):

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'localhost'
EMAIL_HOST_USER = username
Note: The DEFAULT_FROM_MAIL and SERVER_MAIL configuration options can be used to define the From: header of mails sent for internal authentication and error reporting (respectively).

The valid hosts or domain names for the application need to be defined:



Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: Example for a setup using Apache HTTP Server. (Discuss in Talk:Postorius#)
Note: Postorius needs to be run as its own user and group (i.e. postorius). It is using /etc/webapps/postorius/, /var/lib/postorius/ and /run/postorius/ for configurations, static caches and (potentially) sockets, respectively.

Nginx and uWSGI

Postorius comes with a working uWSGI configuration file in /etc/uwsgi/postorius.ini.

Install nginx and uwsgi-plugin-python, create a per-application socket for uWSGI (see UWSGI#Accessibility of uWSGI socket for reference) and enable uwsgi-secure@postorius.socket.

For a local test setup, serving Postorius at add the following Nginx configuration to your setup:

server {
  listen 80;
  server_name localhost;
  charset utf-8;
  client_max_body_size 75M;
  root /usr/share/webapps/postorius;
  access_log /var/log/nginx/access.postorius.log;
  error_log /var/log/nginx/error.postorius.log;

  location ~^/(accounts|admin|postorius)/(.*)$ {
    include /etc/nginx/uwsgi_params;
    uwsgi_pass unix:/run/postorius/postorius.sock;


Note: Run the following commands as the postorius user (e.g. using sudo or su).

After first installation make sure to generate a database:

[postorius]$ django-admin migrate --pythonpath /usr/share/webapps/postorius/ --settings settings

Afterwards, the static data for the application needs to be collected:

[postorius]$ django-admin collectstatic --pythonpath /usr/share/webapps/postorius/ --settings settings

See also