I.e., adding INCLUDE_DMARC: false to the env section of mail-receiver.yml does not seem to do it. This does appear to cause the opendkim and opendmarc daemons to not run (leading to a warning in the logs), but SPF checking is still being performed.
Edited to add:
I think I managed to disable the SPF checks by also adding the following POSTCONF_ line to the env section:
I got this by looking at the commit which introduced the DMARC checks, and seeing what should happen when INCLUDE_DMARC is false.
I know next-to-nothing about how docker images are built, but I am getting the impression that the INCLUDE_DMARC flag is something meant to be set by someone else, somewhere else, at some other time — not something that can be done in mail-receiver.yml.
I’ve found the need to open port 443 on ufw — I got API Request Preparation Failed in the logs otherwise. I thought this is best mentioned because the standard installation instructions mention enabling ufw.
Port 25 is mentioned in the mail-receiver.yml and seems to bypass ufw.
We’re going to remove fast-rejection entirely as the original feature was broken and causing problems for users, specifically this kind of thing:
and it also affects forwarded mail as the pre-delivery test was checking the envelope-from and envelope-to, whereas Discourse uses only the values in headers.
When tailing the logs from that container and sending messages to it, I was seeing a bunch of errors mentioning something like discourse.example.com is not part of MX records or such. I removed the quotes, rebuilt the container and it started working
The sequence of events may matter too:
I configured and launched the mail-receiver container
Some days later I got the MX DNS records going
I validated that MX records were set correctly and then started testing. It wasn’t working - postfix was seeing the messages, but not delivering to discourse, complaining about MX
Removed quotes, rebuilt container, started working
So I’m not sure if the resolution was related to the removal of quotes, or the rebuild of container after MX records were created.