exim4 未通过 LMTP 将消息传递给 mailman

exim4 未通过 LMTP 将消息传递给 mailman

我正在尝试设置mailman3使用exim4来运行我的电子邮件列表。如果我尝试向我的其中一个列表发送电子邮件,则该电子邮件将被传送到实例,然后实例会不断尝试将电子邮件一遍又一遍地传送给自己,直到最终中止该过程,因为它检测到它处于循环中。据我在日志中看到的那样,exim4它从未尝试将电子邮件传送到。mailman-core

我尝试按照以下方式设置一切文档用于将 MTA 连接到邮递员。

我的整个设置正在使用docker,所以我使用 mailmanDocker 镜像和文档。内部网络运行良好,所以这应该不是问题。我能想到的唯一问题是 exim 没有正确加载配置,但我不知道如何检查,只能向它发送电子邮件并观察发生了什么(到目前为止,他们只是陷入了邮件循环)。

docker-compose.yml以下是我的文件中的相关部分:

  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"

以下是 exim Dockerfile(基于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

exim 配置文件如下(我已经检查过它们的存在):

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

相关内容