然而,还不够及时
因此,机器人告诉我:
在我的 mail-receiver.yml 的 env 部分添加 INCLUDE_DMARC: false 并执行 .\launcher rebuild mail-receiver 后,然后执行 .\launcher logs mail-receiver,出现以下内容,并发送了测试邮件;
检测到 x86_64 架构。
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
运行环境:HOSTNAME=ubuntu-mail-receiver LANGUAGE=en_US.UTF-8 MAIL_DOMAIN=discourse.DOMAINNAME.com DOCKER_HOST_IP=172.17.0.1 PWD=/ DISCOURSE_BASE_URL=https://DOMAINNAME.com HOME=/root LANG=en_US.UTF-8 TERM=xterm SHLVL=1 DISCOURSE_API_USERNAME=system LC_ALL=en_US.UTF-8 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin INCLUDE_DMARC=false DISCOURSE_API_KEY=[REDACTED] _=/usr/bin/env
将发送到 discourse.DOMAINNAME.com 的邮件传递给 Discourse
postfix: Postfix 正在使用向后兼容的默认设置
Jul 18 09:00:54 ubuntu-mail-receiver postfix[19]: Postfix 正在使用向后兼容的默认设置
postfix: 详情请参阅 http://www.postfix.org/COMPATIBILITY_README.html
Jul 18 09:00:54 ubuntu-mail-receiver postfix[19]: 详情请参阅 http://www.postfix.org/COMPATIBILITY_README.html
postfix: 要禁用向后兼容,请使用“postconf compatibility_level=3.6”和“postfix reload”
Jul 18 09:00:54 ubuntu-mail-receiver postfix[19]: 要禁用向后兼容,请使用“postconf compatibility_level=3.6”和“postfix reload”
正在启动 Postfix
Jul 18 09:00:54 ubuntu-mail-receiver postfix/master[1]: daemon started -- version 3.7.11, configuration /etc/postfix
Jul 18 09:01:32 ubuntu-mail-receiver postfix/smtpd[141]: connect from btprdrgo003.btinternet.com[65.20.50.48]
Jul 18 09:01:32 ubuntu-mail-receiver postfix/smtpd[141]: warning: connect to Milter service unix:/run/opendkim/opendkim.sock: No such file or directory
Jul 18 09:01:32 ubuntu-mail-receiver postfix/smtpd[141]: warning: connect to Milter service unix:/run/opendmarc/opendmarc.sock: No such file or directory
Jul 18 09:01:32 ubuntu-mail-receiver postfix/smtpd[141]: disconnect from btprdrgo003.btinternet.com[65.20.50.48] ehlo=1 quit=1 commands=2
Jul 18 09:01:32 ubuntu-mail-receiver postfix/smtpd[141]: connect from btprdrgo003.btinternet.com[65.20.50.48]
Jul 18 09:01:32 ubuntu-mail-receiver postfix/smtpd[141]: warning: connect to Milter service unix:/run/opendkim/opendkim.sock: No such file or directory
Jul 18 09:01:32 ubuntu-mail-receiver postfix/smtpd[141]: warning: connect to Milter service unix:/run/opendmarc/opendmarc.sock: No such file or directory
Jul 18 09:01:34 ubuntu-mail-receiver postfix/smtpd[141]: NOQUEUE: reject: RCPT from btprdrgo003.btinternet.com[65.20.50.48]: 554 5.7.1 <[REDACTED_RECIPIENT]@discourse.DOMAINNAME.com>: Recipient address rejected: Mail to this address is not accepted. Check the address and try to send again?; from=<[REDACTED_SENDER]@btinternet.com> to=<[REDACTED_RECIPIENT]@discourse.DOMAINNAME.com> proto=ESMTP helo=<btprdrgo003.btinternet.com>
Jul 18 09:01:34 ubuntu-mail-receiver postfix/smtpd[141]: using backwards-compatible default setting smtpd_relay_before_recipient_restrictions=no to reject recipient “[REDACTED_RECIPIENT]@discourse.DOMAINNAME.com” from client “btprdrgo003.btinternet.com[65.20.50.48]”
Jul 18 09:01:34 ubuntu-mail-receiver postfix/smtpd[141]: disconnect from btprdrgo003.btinternet.com[65.20.50.48] ehlo=1 mail=1 rcpt=0/1 data=0/1 rset=1 quit=1 commands=4/6
好的,我在解决此问题方面取得了一些进展,电子邮件现在可以从 mail-receiver 容器传输到 discourse 容器。
昨天,我在以下目录中通过 nano 创建了一个未指定的文件格式
/var/discourse/shared/mail-receiver/valid_recipients
今天,我通过在我的 volumes 部分添加以下内容,成功地将其挂载到了容器中;
- volume:
host: /var/discourse/shared/mail-receiver/valid_recipients
guest: /etc/postfix/valid_recipients
因此,.\launcher rebuild mail-receiver 可以识别 /etc/postfix/valid_recipients,我在 mail-receiver 的 env 部分添加了以下行;
POSTCONF_smtpd_recipient_restrictions: texthash:/etc/postfix/valid_recipients
然后,在输入 .\launcher enter mail-receiver 后,我会得到积极的结果;
ls -l /etc/postfix/valid_recipients
和
cat /etc/postfix/valid_recipients
简而言之,电子邮件现在已发送到 discourse,它们不会被退回,但随后 DISCOURSE_NOTIFICATION_EMAIL 通过 MailGun 用于宣布 Discourse 管理 UI 中可见的 Email::Receiver::BadDestinationAddress 拒绝。
“收件人”地址与子类别的自定义收件电子邮件地址以及“已接收/已拒绝”日志完全匹配