On Mon, Aug 15, 2011 at 10:30 AM, Jerico2day <jerico2...@gmail.com> wrote:
> 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.

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: <sdfsfsdf...@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

Reply via email to