I am trying to set up mailman3
using exim4
to run my email lists. If I try sending an email to one of my lists, the email gets delivered to the exim4
instance, which then keeps trying to deliver the email to itself over and over again until eventually it aborts the process as it detects it is in a loop. At no point does it try to deliver the email to mailman-core
, as far as I can tell in the logs.
I have tried to set everything up according to the documentation for hooking up the MTA to mailman.
My entire setup is using docker
, so I am using the mailman docker images and documentation. The internal networking works fine for everything, so it shouldn't be a problem with that. The only thing I can think of is that exim is not properly loading the configuration, but I don't know how to check this other than by sending it emails and watching to see what happens (and so far they just get stuck in a mail loop).
Here are the relevant sections in my docker-compose.yml
file:
pg:
image: postgres:11-alpine
volumes:
- db-data:/var/lib/postgresql/data
networks:
- backend
environment:
POSTGRES_DB: mailman
POSTGRES_USER: "${PG_USER}"
POSTGRES_PASSWORD: "${PG_PASS}"
mailman-core:
image: quay.io/maxking/mailman-core:0.2
volumes:
- mm-core-data:/opt/mailman
depends_on:
- pg
- exim
networks:
- backend
environment:
MTA: "exim"
MM_HOSTNAME: "mailman-core"
SMTP_HOST: "exim"
HYPERKITTY_API_KEY: "${HYPERKITTY_API_KEY}"
DATABASE_URL: "postgres://${PG_USER}:${PG_PASS}@pg:5432/mailman"
DATABASE_TYPE: "postgres"
DATABASE_CLASS: "mailman.database.postgresql.PostgreSQLDatabase"
mailman-web:
image: quay.io/maxking/mailman-web:0.2
volumes:
- mm-web-data:/opt/mailman-web-data
networks:
- backend
environment:
UWSGI_STATIC_MAP: /static=/opt/mailman-web-data/static
SERVE_FROM_DOMAIN: mailman.example.com
HYPERKITTY_API_KEY: "${HYPERKITTY_API_KEY}"
MAILMAN_ADMIN_USER: "${MAILMAN_ADMIN_USER}"
MAILMAN_ADMIN_EMAIL: "${MAILMAN_ADMIN_EMAIL}"
SECRET_KEY: "${MAILMAN_SECRET_KEY}"
DATABASE_URL: "postgres://${PG_USER}:${PG_PASS}@pg:5432/mailman"
SMTP_HOST: "exim"
exim:
build: ./exim
networks:
- backend
volumes:
# exim4 needs access to the mailman binaries apparently
# https://mailman.readthedocs.io/en/release-3.0/src/mailman/docs/MTA.html
- mm-core-data:/opt/mailman/core
ports:
- "25:25"
Here's the exim Dockerfile
(based on tianon/exim4
:
FROM tianon/exim4
COPY 25_mm3_macros /etc/exim4/conf.d/main/25_mm3_macros
COPY 455_mm3_router /etc/exim4/conf.d/router/455_mm3_router
COPY 55_mm3_transport /etc/exim4/conf.d/transport/55_mm3_transport
And the exim configuration files are as follows (and I have checked their presence):
25_mm3_macros
:
# Colon-separated list of domains served by mailman
domainlist mm3_domains=lists.example.com
# the LMTP host is the mailman instance running at mailman-core
# for the config of this, see mailman-core/mailman.cfg
MM3_LMTP_HOST=mailman-core
MM3_LMTP_PORT=8024
# exim needs access to mailman-core data, which we have mounted
# at /opt/mailman/core. This is configured in docker-compose.yml.
MM3_HOME=/opt/mailman/core/var
################################################################
# The configuration below is boilerplate:
# you should not need to change it.
# The path to the list receipt (used as the required file when
# matching list addresses)
MM3_LISTCHK=MM3_HOME/lists/${local_part}.${domain}
455_mm3_router
:
mailman3_router:
driver = accept
domains = +mm3_domains
require_files = MM3_LISTCHK
local_part_suffix_optional
local_part_suffix = -admin : \
-bounces : -bounces+* : \
-confirm : -confirm+* : \
-join : -leave : \
-owner : -request : \
-subscribe : -unsubscribe
transport = mailman3_transport
55_mm3_transport
:
mailman3_transport:
debug_print = "Email for mailman"
driver = smtp
protocol = lmtp
allow_localhost
hosts = MM3_LMTP_HOST
port = MM3_LMTP_PORT
rcpt_include_affixes = true