Showing posts with label mail. Show all posts
Showing posts with label mail. Show all posts

Saturday, May 19, 2012

Filter mail with postfix header_checks


First up under /etc/postfix ensure that you have a file called header_checks. If not create it.
Next we want to ensure Postfix is configured to use this file so you do this from a command line by entering the following:
postconf -e "header_checks = regexp:/etc/postfix/header_checks"
The syntax in the header_checks file is:
/regex_pattern/ ACTION
Example :
#/etc/postfix/header_checks

/^From: "spam/ REJECT

/^To: example@example.com/ REDIRECT @esxe.com

/^Subject:.*viagra/ DISCARD
More Detail Link 1 Link 2