#main.cf
header_checks = regexp:/etc/postfix/header_checks
The syntax in the header_checks file is:
/regex_pattern/ ACTION
See a full list of possible actions here
I’m doing three things in the example.
– If the sender’s email address starts with “spammer”, then REJECT it.
– If an email is sent to bob on my server, forward it bob’s real email address
– If the subject contains “Viagra” then discard it.
#/etc/postfix/header_checks
/^From: "spammer/ REJECT
/^To: bob@here.com/ REDIRECT
bob@there.com/^Subject:.*viagra/ DISCARD
#postmap header_checks