To avoid backscatter emails, on Postfix I set:

smtpd_reject_unlisted_sender = true

But this prevents the Odoo from sending some particular emails, since it uses some custom aliases as sender:

SMTPRecipientsRefused: {'myuser@mydomain.com': (550, b'5.1.0 <bounce+92-account.invoice-40@@mydomain.com>: Sender address rejected: @mydomain.com')}

How can I whitelist the Odoo server/app?

New contributor
orsomannaro is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Instead of making this a global directive, place reject_unlisted_sender in smtpd_sender_restrictions (it must appear after permit_mynetworks and permit_sasl_authenticated, if you used that).

Now you can add the sender's IP address to mynetworks = to whitelist it and cause it to bypass this check.

An example from my live mail server:

smtpd_sender_restrictions =
| improve this answer | |
  • I spent a lot on this ... Thank you so much. – orsomannaro Jun 29 at 18:53
  • Trying to tuning the solution I discovered that I have to set this sequence: permit_mynetworks, reject_unlisted_sender, permit_sasl_authenticated otherwise, if permit_sasl_authenticated precedes the other rules, I can send e-mails without adding the IP of the Odoo server to mynetworks. – orsomannaro Jun 29 at 19:08
  • Well that's a policy decision you can make. I have authenticated users able to send email from any address. – Michael Hampton Jun 29 at 19:11

Your Answer

orsomannaro is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.