Settings

Mailman Web supports following settings.

ADMINS = (('Mailman Suite Admin', 'root@localhost'),)

Default list of admins who receive the emails from error logging.

Default Value:

(('Mailman Suite Admin', 'root@localhost'),)
ALLOWED_HOSTS = ['localhost']

Hosts/domain names that are valid for this site; required if DEBUG is False. See https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts

Default Value:

['localhost']
AUTH_PASSWORD_VALIDATORS = [{'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'}, {'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator'}, {'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator'}, {'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator'}]

Default password validators.

Default Value:

[{'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'},
{'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator'},
{'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator'},
{'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator'}]
BASE_DIR = PosixPath('/opt/mailman/web')

The base directory for logs and database.

Default Value:

PosixPath('/opt/mailman/web')
DATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3', 'HOST': '', 'NAME': '/opt/mailman/web/mailman-web.db', 'PORT': ''}}

Default Database to be used. Example for PostgreSQL (recommanded for production):

'default': {
    'ENGINE': 'django.db.backends.postgresql_psycopg2',
    'NAME': 'database_name',
    'USER': 'database_user',
    'PASSWORD': 'database_password',
    'HOST': 'localhost',
}

For MySQL/MariaDB also add the following to the the configuration:

'OPTIONS': {'charset': 'utf8mb4'}  # Enable utf8 4-byte encodings.

Check out Django documentation for more details.

Default Value:

{'default': {'ENGINE': 'django.db.backends.sqlite3',
            'HOST': '',
            'NAME': '/opt/mailman/web/mailman-web.db',
            'PORT': ''}}
DEBUG = False

Enable Development Mode.

Default Value:

False
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

The default implementation to send out emails. This can be customized to something else for testing purposes. https://docs.djangoproject.com/en/dev/topics/email/#email-backends

Default Value:

'django.core.mail.backends.smtp.EmailBackend'
INSTALLED_APPS = ['hyperkitty', 'postorius', 'django_mailman3', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.humanize', 'rest_framework', 'django_gravatar', 'compressor', 'haystack', 'django_extensions', 'django_q', 'allauth', 'allauth.account', 'allauth.socialaccount']

Default list of django applications. Each social account provider is an application and by default no social auth providers are enabled. To enable a social auth provider, you can add them to list of INSTALLED_APPS. For example:

DJANGO_SOCIAL_AUTH_PROVIDERS = [
    'allauth.socialaccount.providers.openid',
    'django_mailman3.lib.auth.fedora',
    'allauth.socialaccount.providers.github',
    'allauth.socialaccount.providers.gitlab',
    'allauth.socialaccount.providers.google',
    'allauth.socialaccount.providers.facebook',
    'allauth.socialaccount.providers.twitter',
    'allauth.socialaccount.providers.stackexchange',
]
INSTALLED_APPS += DJANGO_SOCIAL_AUTH_PROVIDERS

A full list of providers can be found at https://django-allauth.readthedocs.io/en/latest/providers.html Please also note that extra configuration is required after a provider is enabled. Django-allauth’s documentation mentioned above provides more details about how to configure one.

Default Value:

['hyperkitty',
'postorius',
'django_mailman3',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'rest_framework',
'django_gravatar',
'compressor',
'haystack',
'django_extensions',
'django_q',
'allauth',
'allauth.account',
'allauth.socialaccount']
LANGUAGE_CODE = 'en-us'

Default Language code.

Default Value:

'en-us'
LOGGING = {'disable_existing_loggers': False, 'filters': {'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}}, 'formatters': {'simple': {'format': '%(levelname)s %(message)s'}, 'verbose': {'format': '%(levelname)s %(asctime)s %(process)d %(name)s %(message)s'}}, 'handlers': {'console': {'class': 'logging.StreamHandler', 'formatter': 'simple'}, 'file': {'class': 'logging.handlers.WatchedFileHandler', 'filename': '/opt/mailman/web/logs/mailmanweb.log', 'formatter': 'verbose', 'level': 'INFO'}, 'mail_admins': {'class': 'django.utils.log.AdminEmailHandler', 'filters': ['require_debug_false'], 'level': 'ERROR'}}, 'loggers': {'django': {'handlers': ['file'], 'level': 'ERROR', 'propagate': True}, 'django.request': {'handlers': ['mail_admins', 'file'], 'level': 'ERROR', 'propagate': True}, 'hyperkitty': {'handlers': ['file'], 'level': 'DEBUG', 'propagate': True}, 'postorius': {'handlers': ['console', 'file'], 'level': 'INFO'}, 'q': {'handlers': ['console', 'file'], 'level': 'WARNING', 'propagate': False}}, 'version': 1}

Default Logging configuration.

Default Value:

{'disable_existing_loggers': False,
'filters': {'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}},
'formatters': {'simple': {'format': '%(levelname)s %(message)s'},
               'verbose': {'format': '%(levelname)s %(asctime)s %(process)d '
                                     '%(name)s %(message)s'}},
'handlers': {'console': {'class': 'logging.StreamHandler',
                         'formatter': 'simple'},
             'file': {'class': 'logging.handlers.WatchedFileHandler',
                      'filename': '/opt/mailman/web/logs/mailmanweb.log',
                      'formatter': 'verbose',
                      'level': 'INFO'},
             'mail_admins': {'class': 'django.utils.log.AdminEmailHandler',
                             'filters': ['require_debug_false'],
                             'level': 'ERROR'}},
'loggers': {'django': {'handlers': ['file'],
                       'level': 'ERROR',
                       'propagate': True},
            'django.request': {'handlers': ['mail_admins', 'file'],
                               'level': 'ERROR',
                               'propagate': True},
            'hyperkitty': {'handlers': ['file'],
                           'level': 'DEBUG',
                           'propagate': True},
            'postorius': {'handlers': ['console', 'file'], 'level': 'INFO'},
            'q': {'handlers': ['console', 'file'],
                  'level': 'WARNING',
                  'propagate': False}},
'version': 1}
LOGIN_REDIRECT_URL = 'list_index'

Default Django URL to redirect to after a successful login.

Default Value:

'list_index'
LOGIN_URL = 'account_login'

Default Django URL to redirect to for Login.

Default Value:

'account_login'
LOGOUT_URL = 'account_logout'

Default Django URL to Logout the user.

Default Value:

'account_logout'
MIDDLEWARE = ('allauth.account.middleware.AccountMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', 'django_mailman3.middleware.TimezoneMiddleware', 'postorius.middleware.PostoriusMiddleware')

Default Django Middlewares.

Default Value:

('allauth.account.middleware.AccountMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
'django_mailman3.middleware.TimezoneMiddleware',
'postorius.middleware.PostoriusMiddleware')
ROOT_URLCONF = 'mailman_web.urls'

URL Configuration for Django

Default Value:

'mailman_web.urls'
SERVER_EMAIL = 'root@localhost.local'

If you enable email reporting for error messages, this is where those emails will appear to be coming from. Make sure you set a valid domain name, otherwise the emails may get rejected. https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-SERVER_EMAIL

Default Value:

'root@localhost.local'
SITE_ID = 1

Current Django Site being served. This is used to customize the web host being used to serve the current website. For more details about Django site, see: https://docs.djangoproject.com/en/dev/ref/contrib/sites/

Default Value:

1
STATICFILES_DIRS = ()

Additional locations of static files

Default Value:

()
STATICFILES_FINDERS = ('django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'compressor.finders.CompressorFinder')

List of finder classes that know how to find static files in various locations.

Default Value:

('django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'compressor.finders.CompressorFinder')
STATIC_ROOT = '/opt/mailman/web/static'

Default path where static files will be placed.

Default Value:

'/opt/mailman/web/static'
STATIC_URL = '/static/'

URL prefix for static files. Example: “http://example.com/static/”, “http://static.example.com/

Default Value:

'/static/'
TEMPLATES = [{'APP_DIRS': True, 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'OPTIONS': {'context_processors': ['django.template.context_processors.debug', 'django.template.context_processors.i18n', 'django.template.context_processors.media', 'django.template.context_processors.static', 'django.template.context_processors.tz', 'django.template.context_processors.csrf', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'django_mailman3.context_processors.common', 'hyperkitty.context_processors.common', 'postorius.context_processors.postorius']}}]

Default Template finders.

Default Value:

[{'APP_DIRS': True,
 'BACKEND': 'django.template.backends.django.DjangoTemplates',
 'DIRS': [],
 'OPTIONS': {'context_processors': ['django.template.context_processors.debug',
                                    'django.template.context_processors.i18n',
                                    'django.template.context_processors.media',
                                    'django.template.context_processors.static',
                                    'django.template.context_processors.tz',
                                    'django.template.context_processors.csrf',
                                    'django.template.context_processors.request',
                                    'django.contrib.auth.context_processors.auth',
                                    'django.contrib.messages.context_processors.messages',
                                    'django_mailman3.context_processors.common',
                                    'hyperkitty.context_processors.common',
                                    'postorius.context_processors.postorius']}}]
TIME_ZONE = 'UTC'

Default timezone.

Default Value:

'UTC'
USE_I18N = True

Enable internationalization.

Default Value:

True
USE_L10N = True

Enable localization.

Default Value:

True
USE_TZ = True

Use the timezone information.

Default Value:

True
WSGI_APPLICATION = 'mailman_web.wsgi.application'

Wsgi application import path. This will be used by the WSGI server which will be used to deploy this application.

Default Value:

'mailman_web.wsgi.application'
ACCOUNT_AUTHENTICATION_METHOD = 'username_email'

Django Allauth

Default Value:

'username_email'
ACCOUNT_DEFAULT_HTTP_PROTOCOL = 'https'

Protocol for URLs generated for authentication, like email confirmation.

Default Value:

'https'
AUTHENTICATION_BACKENDS = ('django.contrib.auth.backends.ModelBackend', 'allauth.account.auth_backends.AuthenticationBackend')

Authentication backends for Django to be used.

Default Value:

('django.contrib.auth.backends.ModelBackend',
'allauth.account.auth_backends.AuthenticationBackend')
COMPRESS_OFFLINE = True

On a production setup, setting COMPRESS_OFFLINE to True will bring a significant performance improvement, as CSS files will not need to be recompiled on each requests. It means running an additional “compress” management command after each code upgrade. http://django-compressor.readthedocs.io/en/latest/usage/#offline-compression

Default Value:

True
COMPRESS_PRECOMPILERS = (('text/x-scss', 'sassc -t compressed {infile} {outfile}'), ('text/x-sass', 'sassc -t compressed {infile} {outfile}'))

django-compressor https://pypi.python.org/pypi/django_compressor

Default Value:

(('text/x-scss', 'sassc -t compressed {infile} {outfile}'),
('text/x-sass', 'sassc -t compressed {infile} {outfile}'))
DEFAULT_FROM_EMAIL = 'postorius@localhost'

Sender in Emails sent out by Postorius.

Default Value:

'postorius@localhost'
FILTER_VHOST = False

Filter visible Mailing Lists based on the current host being used to serve.

Default Value:

False
HAYSTACK_CONNECTIONS = {'default': {'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine', 'PATH': 'fulltext_index'}}

Django-Haystack connection parameters.

Default Value:

{'default': {'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
            'PATH': 'fulltext_index'}}
HYPERKITTY_ENABLE_GRAVATAR = True

Use gravatar in HyperKitty and Postorius. If disabled django_gravatar can be removed from INSTALLED_APPS: INSTALLED_APPS.remove(‘django_gravatar’)

Default Value:

True
MAILMAN_ARCHIVER_FROM = ('127.0.0.1', '::1')

Host for Mailman Core, from where Hyperkitty will accept connections for archiving.

Default Value:

('127.0.0.1', '::1')
MAILMAN_ARCHIVER_KEY = 'SecretArchiverAPIKey'

Mailman Core Shared archiving key. This value is set in the : mailman-hyperkitty’s configuration file.

Default Value:

'SecretArchiverAPIKey'
MAILMAN_REST_API_PASS = 'restpass'

Mailman Core API user’s password.

Default Value:

'restpass'
MAILMAN_REST_API_URL = 'http://localhost:8001'

Mailman Core default API Path

Default Value:

'http://localhost:8001'
MAILMAN_REST_API_USER = 'restadmin'

Mailman Core API user

Default Value:

'restadmin'
POSTORIUS_TEMPLATE_BASE_URL = 'http://localhost:8000'

Base URL where Django/Mailman-web would be listening for requests. Used by Mailman Core for fetching templates.

Default Value:

'http://localhost:8000'
Q_CLUSTER = {'orm': 'default', 'retry': 360, 'save_limit': 100, 'timeout': 300, 'workers': 2}

Django Q connection parameters.

Default Value:

{'orm': 'default',
'retry': 360,
'save_limit': 100,
'timeout': 300,
'workers': 2}
SOCIALACCOUNT_PROVIDERS = {'facebook': {'FIELDS': ['email', 'name', 'first_name', 'last_name', 'locale', 'timezone'], 'METHOD': 'oauth2', 'SCOPE': ['email'], 'VERSION': 'v2.4'}, 'google': {'AUTH_PARAMS': {'access_type': 'online'}, 'SCOPE': ['profile', 'email']}, 'openid': {'SERVERS': [{'id': 'yahoo', 'name': 'Yahoo', 'openid_url': 'http://me.yahoo.com'}]}}

Extra configuration for Social auth. For these configuration to be used. each of the social account providers must be first added in INSTALLED_APPS. See mailman_web.settings.base.INSTALLED_APPS for more configuration.

Default Value:

{'facebook': {'FIELDS': ['email',
                        'name',
                        'first_name',
                        'last_name',
                        'locale',
                        'timezone'],
             'METHOD': 'oauth2',
             'SCOPE': ['email'],
             'VERSION': 'v2.4'},
'google': {'AUTH_PARAMS': {'access_type': 'online'},
           'SCOPE': ['profile', 'email']},
'openid': {'SERVERS': [{'id': 'yahoo',
                        'name': 'Yahoo',
                        'openid_url': 'http://me.yahoo.com'}]}}