On 11/30/2010 8:18 AM, Kammen van, Marco, Springer SBM NL wrote:
Dear List,
Using Postfix 2.4.6.
Finally resolved a problem that has been laying around for a while, just want
to verify if this is the correct solution...
We have a canonical.regexp:
/us...@.*\.subdomain\.com/ u...@domain.com
main.cf:
canonical_maps = hash:/usr/local/postfix/etc/canonical
regexp:/usr/local/postfix/etc/canonical.regexp
canonical_classes = envelope_sender, header_sender, header_recipient
Mails from internal application servers, are relayed over our smarthosts and
send mail as u...@server1.subdomain.com for cleanlyness we want this to show-up
in outlook as u...@domain.com so users can make simple outlook rules.
Now all mails that where generated on the smarthosts themselves are properly
rewritten, but mails from the application servers still showup as
u...@server1.subdomain.com.
Reading the canonical man page again I noticed:
NOTE: Postfix versions 2.2 and later rewrite message headers from
remote SMTP clients only if the client matches the
local_header_rewrite_clients parameter, or if the
remote_header_rewrite_domain configuration parameter specifies a non-empty
value. To
get the behavior before Postfix 2.2, specify "local_header_rewrite_clients =
static:all".
Now local_header_rewrite_clients wasn't defined so defaulted to
permit_inet_interfaces, which I guess explains why it does work for mail
generated on the smarthosts but not on 'clients'?
Changed this parameter to local_header_rewrite_clients = static:all, now
rewriting works, but I'm not sure if this is the recommended way....
Thanks for any tips!
That setting emulates postfix 2.2 behavior, and will rewrite
headers from both local and foreign clients.
That's not terrible, but you might want to make it more
specific -- that's why the parameter was invented.
If the application servers are listed in mynetworks, you can use
local_header_rewrite_clients =
permit_inet_interfaces,
permit_mynetworks
-- Noel Jones