Testing the Discourse email setup from a Thunderbird client, I can send and receive email without a problem. But in Discourse, no email is sent with this error:
501 5.5.4 You are not allowed to send from this address.
What does this error mean?
Where is it generated? According to what rules?
The SPF record only allows the MX to send email (configured as DISCOURSE_SMTP_ADDRESS), which does not seem to pose any issues with other domains, since SMTP clients connect to the MX to send.
It (probably) means thunderbird is sending from an address like user@example.com and your forum is sending from user@forum.example.com. You may want to change your notification_email address.
Is whatever service that is designed for sending transactional email?
The error message means the sender address is not allowed. Maybe because it does not appear in the mail server’s allowed senders configuration.
Huh, I found my error, thanks to your input, @pfaffman.
The ‘address’ in the error message relates to the sender address. I was focused on the IP address, so I was misled.
Once I checked the notification address (DISCOURSE_NOTIFICATION_EMAIL in the containers/app.yml), I realized my mail server was missing an entry for that sender: adding the alias solved the issue.