Here's an example from my email headers
Message-Id: <zarafa.4e46e3b1.34...@my.domain.com>
The problem is, is that "my.domain.com" is an internal server that
sends mail to a relay server. I don't want people really seeing my
internal domain or IP. I was able to change other parts of the header
to remove my local address using header_checks.
I'd like to have postfix dynamically change "my.domain.com" only on
Message-Id header to some arbitrary domain that would be
public-facing for all outgoing mail and change it back for incoming
mail.
Unfortunately, I'm not quite sure how to do that. I would appreciate
any assistance.
Thanks!
You can mangle an existing Message-ID with the REPLACE action just
like any other header.
Maybe your mail arrives without a message-id, so there isn't one
there to mangle. Postfix will insert a message-id if there isn't
one, and header_checks won't see the generated header.
-- Noel Jones
First in your main.cf:
header_checks = pcre:/etc/postfix/header_checks
Secondly in your /etc/postfix/header_checks:
/Message-Id:\s+<(.*?)@my.domain.com>/ REPLACE Message-Id: <$1...@my.domain.net>
Thirdly, test it:
$ postmap -q "Message-Id: <sdfsf...@my.domain.com>"
pcre:/etc/postfix/header_checks
> Thanks!
Note, ensure that your postfix installation supports pcre. My desktop
is debian, so I call:
$ apt-cache search postfix-pcre
postfix-pcre - PCRE map support for Postfix
Care to explain how you intend to guarantee the uniqueness of the
message-ids?
Bastian
--
We Klingons believe as you do -- the sick should die. Only the strong
should live.
-- Kras, "Friday's Child", stardate 3497.2