문제는 제가 받는 바운스 메일에 from 필드가 포함되어 있지 않아서, API 호출이 https://forum.example.com/admin/email/smtp_should_reject.json?from=&to=replies+verp-326f6e22828d2543ba65497a47608f13@mail.forum.example.com처럼 이루어질 때 다음 오류와 함께 400 상태 코드를 반환하기 때문인 것 같습니다:
{"errors":["param is missing or the value is empty or invalid: from"]}
mail-receiver 로그의 일부는 다음과 같습니다.
Nov 03 07:34:53 mail postfix/smtpd[1044]: connect from v-108-120-yyy-74-srvr1.xxx.com[74.91.xxx.108]
<19>Nov 3 07:34:53 discourse-smtp-fast-rejection[1048]: Failed to GET smtp_should_reject answer from https://forum.example.com/admin/email/smtp_should_reject.json: 400<22>Nov 3 07:34:53 policyd-spf[1049]: : prepend Received-SPF: None (no SPF record) identity=helo; client-ip=74.91.xxx.108; helo=v-148-29-xxx-192-srvr1.xxx.com; envelope-from=<>; receiver=mail.forum.example.com Nov 03 07:34:53 mail postfix/smtpd[1044]: NOQUEUE: reject: RCPT from v-108-120-yyy-74-srvr1.xxx.com[74.91.xxx.108]: 450 4.7.1 <replies+verp-326f6e22828d2543ba65497a47608f13@mail.forum.example.com>: Recipient address rejected: Internal error, API request failed; from=<> to=<replies+verp-326f6e22828d2543ba65497a47608f13@mail.forum.example.com> proto=ESMTP helo=<v-148-29-xxx-192-srvr1.xxx.com>
그러나, 올바른 from 주소(제 이메일을 넣는 경우)가 포함되어 있더라도 다음과 같은 응답이 돌아옵니다.
{"reject":true,"reason":"Mail to this address is not accepted. Check the address and try to send again?"}
mail-receiver.yaml 파일을 이렇게 작성하고 있습니다 (잠시 동안만, 아니면 계속 이렇게 두어야 하나요? @supermathie)
# this is the incoming mail receiver container template
##
## After making changes to this file, you MUST rebuild
## /var/discourse/launcher rebuild mail-receiver
##
## BE *VERY* CAREFUL WHEN EDITING!
## YAML FILES ARE SUPER SUPER SENSITIVE TO MISTAKES IN WHITESPACE OR ALIGNMENT!
## visit http://www.yamllint.com/ to validate this file as needed
base_image: discourse/mail-receiver:release
update_pups: false
expose:
- "25:25" # SMTP
env:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
LANGUAGE: en_US.UTF-8
## Where e-mail to your forum should be sent. In general, it's perfectly fine
## to use the same domain as the forum itself here.
MAIL_DOMAIN: community.example.com
# uncomment these (and the volume below!) to support TLS
POSTCONF_smtpd_tls_key_file: /letsencrypt/community.example.com/community.example.com.key
POSTCONF_smtpd_tls_cert_file: /letsencrypt/community.example.com/community.example.com.crt
POSTCONF_smtpd_tls_security_level: may
POSTCONF_myhostname: community.example.com
POSTCONF_mynetworks: "127.0.0.0/8 [::1]/128 [fe80::]/64 172.17.0.0/16"
POSTCONF_smtpd_recipient_restrictions: ""
## The base URL for this Discourse instance.
## This will be whatever your Discourse site URL is. For example,
## https://discourse.example.com. If you're running a subfolder setup,
## be sure to account for that (ie https://example.com/forum).
DISCOURSE_BASE_URL: 'https://community.example.com'
## The master API key of your Discourse forum. You can get this from
## the "API" tab of your admin panel.
DISCOURSE_API_KEY: <YOURKEY>
## The username to use for processing incoming e-mail. Unless you have
## renamed the `system` user, you should leave this as-is.
DISCOURSE_API_USERNAME: system
volumes:
- volume:
host: /var/discourse/shared/mail-receiver/postfix-spool
guest: /var/spool/postfix
# uncomment to support TLS
- volume:
host: /var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/
guest: /letsencrypt