Exceptionally permit receipt of message with bad sender address

I would like a receive a specific message from a service that has a misconfigured mailgun configuration. Mail-in-a-box is rejecting the messages because the sender is a domain with no MX records. Is there a way to make Mail-in-a-box accept these broken messages either temporarily for this sender in particular?

Jul  9 23:00:16 XXXXXXXX postfix/smtpd[25506]: NOQUEUE: reject: RCPT from m228-15.mailgun.net[159.135.228.15]: 450 4.1.8 <bounce+XXXX.XXXXX-XXXXXXXXX@mg.vshred.com>: Sender address rejected: Domain not found; from=<bounce+XXXX.XXXXX-XXXXXXXXX@mg.vshred.com> to=<XXXX@XXXX.XXX> proto=ESMTP helo=<m228-15.mailgun.net>

You could try following my guide here:

But instead of using DISCARD use OK.

I’m actually not certain of the behavior, but access(5) states:

ACCEPT ACTIONS
OK           Accept the address etc. that matches the pattern.

Unless someone can chime in with a better solution, try this and please post back with your results.

Hi, thanks for the suggestion. Unfortunately I still get the same NOQUEUE: reject message. I was able to build the db file using postmap (and input mg.vshred.com OK). I tried adding check_sender_access hash:/etc/postfix/sender_access both to smtpd_relay_restrictions and to smtpd_recipient_restrictions.

Success! I added it as the first entry to smtpd_sender_restrictions and it worked. Thank you for you help.

Did you try what I recommended to add check_sender_access only to smtpd_relay_restrictions?

Yes, I tried each of the three in isolation.

Usually, placing check_sender_access in smtpd_sender_restrictions will change the behavior of postfix in ways that are unrelated to what you are trying to change.

Any changes to the parameters of postfix need to be very carefully researched, because very little there is intuitively obvious.