Configure Web Frontend

Mailman 3 has a web frontend which can be used to administer the Core, manage subscriptions and view the Archives. There are two principal components, Postorius, the Mailman’s web frontend, and Hyperkitty, the Mailman’s official Archiver.

Both Postorius and Hyperkitty are built atop Django, a Python based web framework.

See also

What is Django?

Django is generally configured using a python module called settings.py which is usually present at the root of the Django project. It doesn’t have to be at the root of the project, but anywhere importable by python.

Assuming that you have already cloned or installed the Django project and know their location, we can now start configuring Mailman Components. If you haven’t have a look at Setting up Django Project .

Setting up Email

It is important that Django be able to send emails to verify the addresses that are subscribing to the Mailman. This configuration is separate from what is done is Core. Please have a look at how to setup email backend for django. A simple configuration would look something like this for a mail server listening on localhost:::

# To be added to Django's settings.py

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'localhost'
EMAIL_PORT = 25
EMAIL_HOST_USER = <username>
EMAIL_HOST_PASSWORD = <password>

Here are some settings that determine how your emails from them look like:

  • DEFAULT_FROM_EMAIL : This is the default address that used used as the FROM header in all the emails from your django installation.
  • SERVER_EMAIL : This is the address from which the errors emails will be sent to you.

Note that both of these are general Django related settings and will affect other parts of your Django installation too

Setting up Database

Django supports a wide variety of databases and you can have a look at the documentation for different options and ways to configure your database to use with Django.

Configure Login to Django

Postorius & Hyperkitty both use django-allauth for authentication because it supports a wire variety of social providers and also allows users to sign up with their email if they desire.

Note that if you have any problems with the account signup/signin related emails, you should look the documentation for django-allauth.

Some of the very basic settings that are required to be set for Postorius & Hyperkitty to work are mentioned below:

  • ACCOUNT_AUTHENTICATION_METHOD = “username_email”
  • ACCOUNT_EMAIL_REQUIRED = True
  • ACCOUNT_EMAIL_VERIFICATION = “mandatory”
  • ACCOUNT_DEFAULT_HTTP_PROTOCOL = “http”
  • ACCOUNT_UNIQUE_EMAIL = True

Configure Postorius & Hyperkitty

Here are the parameters that will affect Postorius and Hyperkitty will function. These parameters are configured in your Django’s settings.py.

  • MAILMAN_REST_API_URL : Complete URL to the Core’s REST API Server. Usually, Mailman Core listens on port 8001 for REST API. e.g. http://localhost:8001/

  • MAILMAN_REST_API_USER : Username for the Core’s REST API, default value in core is ‘restadmin’ if not set.

  • MAILMAN_REST_API_PASS : Password for Mailman REST API User, default value in core is ‘restpass’ if not set.

  • MAILMAN_ARCHIVER_KEY : The Key used to authenticate the emails for archiving in Hyperkitty. Its value should be exactly same as set in Core.

    Also note that the value in settings.py will be within single quotes, but in mailman.cfg it will be without any quotes.

  • FILTER_VHOST : Filter the list of available lists in Hyperkitty depending on the domain it is being currently served from. Mailman 3 supports multiple domains in a single installation.

  • Add compressor.finders.CompressorFinder to your STATICFILES_FINDERS.

  • LOGIN_URL = ‘account_login’

  • LOGIN_REDIRECT_URL = ‘list_index’

  • LOGOUT_URL = ‘account_logout’

  • This setting is for django-compressor which is used here to compile and compress static files:

    COMPRESS_PRECOMPILERS = (
      ('text/x-scss', 'sassc -t compressed {infile} {outfile}'),
      ('text/x-sass', 'sassc -t compressed {infile} {outfile}'),
    )
    
  • Hyperkitty uses django-haystack for its full text search:

    HAYSTACK_CONNECTIONS = {
          'default': {
          'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
          'PATH': os.path.join(BASE_DIR, "fulltext_index"),
          # You can also use the Xapian engine, it's faster and more accurate,
          # but requires another library.
          # http://django-haystack.readthedocs.io/en/v2.4.1/installing_search_engines.html#xapian
          # Example configuration for Xapian:
          #'ENGINE': 'xapian_backend.XapianEngine'
          },
    }
    
  • Hyperkitty uses django_q as a task queue. It supports various different backends like Redis, Disque, IronMQ, SQS etc. Please check the documentation to better understand how to configure it. The most basic setup where it uses Django orm as the queue can be configured using the settings below:

    Q_CLUSTER = {
       'timeout': 300,
       'save_limit': 100,
       'orm': 'default',
    }