我在运行 docker-mail-server 的小型 VPS 上运行邮件服务器。
它一直运行良好,直到 2024-10-02 开始拒绝电子邮件。
我更新了证书,即使它们在 2024-10-15(停止工作两周后)到期。
每当我收到一封电子邮件时,日志中都会出现以下跟踪(这里是从我的 protonmail 地址发送的电子邮件):
NOQUEUE: reject: RCPT from unknown[185.70.43.21]: 450 4.1.8 <[email protected]>: Sender address rejected: Domain not found; from=<[email protected]> to=<contact@$MY_DOMAIN> proto=ESMTP helo=<mail-4321.protonmail.ch>
将其解释为“我不知道该域名是什么,所以我拒绝该电子邮件”,我运行了dig protonmail.com
,并给出了正确的输出:
; <<>> DiG 9.18.28-1~deb12u2-Debian <<>> protonmail.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12017
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;protonmail.com. IN A
;; ANSWER SECTION:
protonmail.com. 1200 IN A 185.70.42.12
;; Query time: 31 msec
;; SERVER: 213.186.33.99#53(213.186.33.99) (UDP)
;; WHEN: Thu Oct 10 17:32:34 UTC 2024
;; MSG SIZE rcvd: 59
Ping protonmail.com 也有效。有没有什么办法可以解决这个问题或它可能来自哪里?我想确保它不是来自用户错误,然后再在 github 上打开问题。
编辑:看来容器本身无法访问互联网。我无法 ping 域或 IP 地址。这是我正在使用的 docker compose:
services:
mailserver:
image: ghcr.io/docker-mailserver/docker-mailserver:latest
container_name: mailserver
# Provide the FQDN of your mail server here (Your DNS MX record should point to this value)
hostname: mail.$MY_DOMAIN.fr
env_file: mailserver.env
# More information about the mail-server ports:
# https://docker-mailserver.github.io/docker-mailserver/latest/config/security/understanding-the-ports/
ports:
- "143:143" # IMAP4 (explicit TLS => STARTTLS)
- "465:465" # ESMTP (implicit TLS)
- "587:587" # ESMTP (explicit TLS => STARTTLS)
- "993:993" # IMAP4 (implicit TLS)
- "25:25"
volumes:
- ./docker-data/dms/mail-data/:/var/mail/
- ./docker-data/dms/mail-state/:/var/mail-state/
- ./docker-data/dms/mail-logs/:/var/log/mail/
- ./docker-data/dms/config/:/tmp/docker-mailserver/
- /etc/localtime:/etc/localtime:ro
- /docker/vol/dms/cert:/var/cert
- /etc/letsencrypt:/etc/letsencrypt
restart: always
stop_grace_period: 1m
healthcheck:
test: "ss --listening --tcp | grep -P 'LISTEN.+:smtp' || exit 1"
timeout: 3s
retries: 0
我尝试创建一个外部网络并将服务绑定到它,但没有成功。