Add documentation for smtp env vars (#326)

* add documentation for smtp env vars

* wrap at 80 lines

* add smtp env vars to web container docs
This commit is contained in:
Simon
2019-04-29 23:04:03 +02:00
committed by Abhilash Raj
parent 80eb38bf46
commit 439f308bf8
2 changed files with 35 additions and 20 deletions

View File

@@ -187,8 +187,8 @@ These are the settings that you MUST change before deploying:
also replaces Django's default `example.com` SITE and becomes the default SITE also replaces Django's default `example.com` SITE and becomes the default SITE
(with SITE_ID=1). (with SITE_ID=1).
- `HYPERKITTY_API_KEY`: Hyperkitty's API Key, should be set to the same value as - `HYPERKITTY_API_KEY`: Hyperkitty's API Key, should be set to the same value
set for the mailman-core. as set for the mailman-core.
- `MAILMAN_ADMIN_USER`: The username for the admin user to be created by default. - `MAILMAN_ADMIN_USER`: The username for the admin user to be created by default.
@@ -196,22 +196,29 @@ These are the settings that you MUST change before deploying:
- `SECRET_KEY`: Django's secret key, mainly used for signing cookies and others. - `SECRET_KEY`: Django's secret key, mainly used for signing cookies and others.
Please note here that if you choose to create the admin user using the environment Please note here that if you choose to create the admin user using the
variables mentioned above (`MAILMAN_ADMIN_USER` & `MAILMAN_ADMIN_EMAIL`), no password environment variables mentioned above (`MAILMAN_ADMIN_USER` &
is set for your admin account. To set a password, plese follow the "Forgot Password" `MAILMAN_ADMIN_EMAIL`), no password is set for your admin account. To set a
link on the "Sign In" page. password, plese follow the "Forgot Password" link on the "Sign In" page.
To configure the mailman-web container to send emails, add this to your `settings_local.py`.: To configure the mailman-web container to send emails, add this to your
`settings_local.py`.:
``` ```
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = '172.19.199.1' EMAIL_HOST = '172.19.199.1'
EMAIL_PORT = 25 EMAIL_PORT = 25
``` ```
This is required in addition to the [Setup your MTA](#setting-up-your-mta) section below,
which covers email setup for Mailman Core.
For more details on how to configure this image, please look at [Mailman-web's Alternatively, you can use the environment variables `SMTP_HOST` (defaults to
Readme](web/README.md) `172.19.199.1`), `SMTP_PORT` (defaults to `25`), `SMTP_HOST_USER` (defaults to
an empty string), `SMTP_HOST_PASSWORD` (defaults to an empty string) and
`SMTP_USE_TLS` (defaults to `False`).
This is required in addition to the [Setup your MTA](#setting-up-your-mta)
section below, which covers email setup for Mailman Core.
For more details on how to configure this image, please look at
[Mailman-web's Readme](web/README.md)
### Mailman-Core ### Mailman-Core
@@ -342,8 +349,8 @@ your own MTA inside a container and have them relay emails to the mailman-core
container or just install an MTA on the host and have them relay emails. container or just install an MTA on the host and have them relay emails.
To use [Exim4][8], it should be setup to relay emails from `172.19.199.3` and To use [Exim4][8], it should be setup to relay emails from `172.19.199.3` and
`172.19.199.2`. The mailman specific configuration is provided in the repository `172.19.199.2`. The mailman specific configuration is provided in the
at `core/assets/exim`. There are three files repository at `core/assets/exim`. There are three files
- [25_mm_macros](core/assets/exim/25_mm3_macros) to be placed at - [25_mm_macros](core/assets/exim/25_mm3_macros) to be placed at
`/etc/exim4/conf.d/main/25_mm3_macros` in a typical Debian install of `/etc/exim4/conf.d/main/25_mm3_macros` in a typical Debian install of
@@ -357,8 +364,9 @@ at `core/assets/exim`. There are three files
`/etc/exim4/conf.d/transport/55_mm3_transport` in a typical Debian install of exim4. `/etc/exim4/conf.d/transport/55_mm3_transport` in a typical Debian install of exim4.
Also, the default configuration inside the mailman-core image has the MTA set to Also, the default configuration inside the mailman-core image has the MTA set
Exim, but just for reference, it looks like this: to Exim, but just for reference, it looks like this:
``` ```
# mailman.cfg # mailman.cfg
[mta] [mta]
@@ -372,9 +380,9 @@ configuration: python:mailman.config.exim4
``` ```
To use [Postfix][12], edit the `main.cf` configuration file, which is typically To use [Postfix][12], edit the `main.cf` configuration file, which is typically
at `/etc/postfix/main.cf` on Debian-based operating systems. Add `172.19.199.2` at `/etc/postfix/main.cf` on Debian-based operating systems. Add
and `172.19.199.3` to `mynetworks` so it will relay emails from the containers `172.19.199.2` and `172.19.199.3` to `mynetworks` so it will relay emails from
and add the following configuration lines: the containers and add the following configuration lines:
``` ```
# main.cf # main.cf
@@ -392,8 +400,8 @@ relay_domains =
regexp:/opt/mailman/core/var/data/postfix_domains regexp:/opt/mailman/core/var/data/postfix_domains
``` ```
To configure Mailman to use Postfix, add the following to `mailman-extra.cfg` at To configure Mailman to use Postfix, add the following to `mailman-extra.cfg`
`/opt/mailman/core/mailman-extra.cfg`. at `/opt/mailman/core/mailman-extra.cfg`.
``` ```
# mailman-extra.cfg # mailman-extra.cfg

View File

@@ -51,6 +51,13 @@ change them unless you know what you want.
- `SMTP_PORT`: Port used for SMTP. Default is `25`. - `SMTP_PORT`: Port used for SMTP. Default is `25`.
- `SMTP_HOST_USER`: Used for SMTP authentication. Default is an empty string.
- `SMTP_HOST_PASSWORD`: Default is an empty string.
- `SMTP_USE_TLS`: Specifies wheather the SMTP connection is encrypted
via TLS. Default is `False`.
- `DJANGO_LOG_URL`: Path to the django's log file. Defaults to - `DJANGO_LOG_URL`: Path to the django's log file. Defaults to
`/opt/mailman-web-data/logs/mailmanweb.log`. `/opt/mailman-web-data/logs/mailmanweb.log`.