Postfix check_headers

Application: PostfixVersion: 2.9System: DebianDescription:
Use check_headers to replace some headers from emails send by postfix

Basics:

settings in main.conf:

header_checks = regexp:/etc/postfix/header_checkMeaning: regexp is one of the methods

file header_check:

/(.*)(something)/ REPLACE $1Meaning: will find "something" and replace it with $1=(.*)[everything before], it means deletion of "something"

/^(Received: from somehost)(.*)/ REPLACE X-$1$2Meaning: will match (everything in bracket) eg $1 and replace it with X-$1[X-Received: from somehost] and append the rest of the header

/^Received: from 127.0.0.1/ IGNORE

/^Received: from localhost/ IGNORE

/(.*)(..\(This is the line from multiline header\))(.*)/ REPLACE $1$3Meaning: will add strings before, $2=[can be second line for example] replace with nothing and append the rest BEWARE of .. which is needed to have proper header format otherwise you can received BAD HEADER and ur mgs can be discarted