diff --git a/core/README.md b/core/README.md index bed1905..d941125 100644 --- a/core/README.md +++ b/core/README.md @@ -52,6 +52,8 @@ standard version of docker-compose.yaml from this repository. - `MAILMAN_REST_PASSWORD`: Which password should Core use for the REST API. If not defined the default is `restpass`. +- `MTA`: Mail Transfer Agent to use. Either `exim` or `postfix`. Default value is `exim`. + - `SMTP_HOST`: IP Address/hostname from which you will be sending emails. Default value is `172.19.199.1`, which is the address of the Host OS. diff --git a/core/docker-entrypoint.sh b/core/docker-entrypoint.sh index 9734ead..e6812ee 100755 --- a/core/docker-entrypoint.sh +++ b/core/docker-entrypoint.sh @@ -114,16 +114,7 @@ then fi # Generate a basic mailman.cfg. -cat >> /etc/mailman.cfg < /etc/mailman.cfg << EOF [runner.retry] sleep_time: 10s @@ -137,10 +128,23 @@ admin_pass: $MAILMAN_REST_PASSWORD class: mailman_hyperkitty.Archiver enable: yes configuration: /etc/mailman-hyperkitty.cfg + EOF -# Generate a basic configuration to use postfix. -cat > /etc/postfix-mailman.cfg < /tmp/exim-mailman.cfg < /etc/postfix-mailman.cfg << EOF [postfix] transport_file_type: regex # While in regex mode, postmap_command is never used, a placeholder @@ -148,6 +152,33 @@ transport_file_type: regex postmap_command: true EOF +# Generate a basic configuration to use postfix. +cat > /tmp/postfix-mailman.cfg <> /etc/mailman.cfg +elif [ "$MTA" == "postfix" ] +then + echo "Using Postfix configuration" + cat /tmp/postfix-mailman.cfg >> /etc/mailman.cfg +else + echo "No MTA environment variable found, defaulting to Exim" + cat /tmp/exim-mailman.cfg >> /etc/mailman.cfg +fi + +rm -f /tmp/{postfix,exim}-mailman.cfg if [[ -e /opt/mailman/mailman-extra.cfg ]] then