Postfix selective header_checks: smtpd_relay_restrictions vs. smtpd_recipient_restrictions

Posted by luke on Server Fault See other posts from Server Fault or by luke
Published on 2014-05-26T12:00:58Z Indexed on 2014/06/01 9:29 UTC
Read the original article Hit count: 378

Filed under:

Some of my customers implemented commercial software that violate email-RFCs such that we have had to relax our header checks. In consequence, we receive more spam.

Prolog:

  • I know the domains (customer.com) and IP-addresses (a.b.c.d/C) these emails come from

Kind request for help:

  • Is it possible to setup one Postfix (2.11) instance on Linux such that:
    • It applies only some header checks for emails from .*@customer.com
    • But applies all header checks for all other email sources?

I thought of a combination of mynetworks that includes the subnet a.b.c.d/C in smtpd_recipient_restrictions -- allowing all these messages through -- and simultaneously avoid an open-relay with smtpd_relay_restrictions.

However, this has not worked out as expected.

Any idea or help is highly appreciated.

Thanks in advance.

Luke

==EDIT==

For the current issue, I solved the problem by prepending REDIRECTs to header_checks as follows:

/^received: from.*customer.com.*by mail.own.com.*for.*luke@own.*/
  REDIRECT [email protected]

This works so far as neeeded.

Irrespective thereof, I am still looking for a postfix configuration that would turn this text-based setting into an IP-Address-Range based forwarding rule....

Thanks.

Luke

© Server Fault or respective owner

Related posts about postfix