How do I remove Received-headers from emails?
FWIW, this is a bad idea for Received
headers but here's the answer anyways. womble mentioned content_filter
as a recommended solution. IMHO that's overkill, Postfix supports this natively via header_checks
.
/etc/postfix/main.cf:
header_checks = regexp:/etc/postfix/header_checks
/etc/postfix/header_checks:
/^Received:.*\[127\.0\.0\.1\]/ IGNORE
/^Received:.*\from apache@localhost/ IGNORE
Every header is useless -- until the day you really actually need that information to diagnose some irritating problem.
If you're dead-set on doing this, then you want to look at the content_filter
parameter.