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?

1 Answer 1


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 =
  • I spent a lot on this ... Thank you so much. Jun 29, 2020 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. Jun 29, 2020 at 19:08
  • Well that's a policy decision you can make. I have authenticated users able to send email from any address. Jun 29, 2020 at 19:11

Your Answer

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.