Update: I tested the current main branch
I built the current main branch locally and found another issue.
The old Docker Hub release image still runs the old fast-rejection code and fails during RCPT with:
450 4.7.1 Recipient address rejected: Internal error, API request failed
However, the current main branch has already removed the smtp_should_reject / fast-rejection implementation. After building main, Postfix instead fails with:
warning: connect to private/policy: No such file or directory
451 4.3.5 Recipient address rejected: Server configuration problem
I traced this to two remaining references in the Dockerfile:
check_policy_service unix:private/policy
The policy service itself has been removed, but smtpd_recipient_restrictions still references its socket.
I removed unix:private/policy from smtpd_recipient_restrictions, rebuilt the image, and incoming SMTP mail was then accepted successfully.
After switching to a Global API Key, delivery to Discourse also succeeded:
dsn=2.0.0, status=sent (delivered via discourse service)
So there seem to be two separate issues:
- The published
discourse/mail-receiver:releaseimage is outdated and still contains the old fast-rejection implementation. - The current
mainbranch removed that implementation, but theDockerfilestill configures Postfix to useunix:private/policy.
There may also be a separate issue with granular API keys: a key scoped only to receive emails returned HTTP 404 from /admin/email/handle_mail, while a Global API Key returned HTTP 200.
I can submit a PR for the two stale private/policy references in the Dockerfile if that would be helpful.