Postfix header_checks using regexp proper setup

postfixregexreplacesmtp-headers

I just can't seem to figure out why header_checks are not being evaluated.
I'm on Ubuntu 12.04, postfix 2.7, dovecote, spamassasin, clamav, amavis.

I add following line to /etc/postfix/main.cf :

header_checks = regexp:/etc/postfix/header_checks

And here is header_checks :

/From: .*/ REPLACE From: noreply@valid.mydomain.com

To test out regexp :

#postmap -q "From: <werwe>" regexp:/etc/postfix/header_checks

which evaluates correctly and give me return output of :

REPLACE From: noreply@valid.mydomain.com

However, when I try to send email from commandline or from php webpage, postfix will not replace the From header. I'm stumped.

I want to rewrite all outgoing emails:

From: Confirmation Email<webapp@invalid.mydomain.com>   

— changed to —

From: Confirmation Email<noreply@valid.mydomain.com>

Any help will be greatly appreciated.

Best Answer

Solved - Following line in /etc/postfix/master.cf was causing conflict :

pickup    fifo  n       -       -       60      1       pickup
    -o content_filter=
#   -o receive_override_options=no_header_body_checks  //commented this line out
Related Topic