On 1/28/2011 12:51 PM, Jerrale G wrote:
> We want the headers to correct show the mail system, with a bug in
> centos, it shows localhost  or 127.0.0.1 where it should show
> mail.sheltoncomputers.com for PROPER, correct tracking.
>
> /etc/postfix/header_checks.pcre:
>
>     s/(127\.0\.0\.1|localhost)/gi
>         REPLACE  mail.sheltoncomputers.com
>
> What is wrong with the above? It is not replacing all instances of
> 127.0.0.1 OR localhost with mail.sheltoncomputers.com. You can see
> where we want these replaced in our headers.

First, understand that a pcre_table file is not sed (implied by the s/),
the correct syntax is documented (man 5 pcre_table).

Second, a header_checks REPLACE action will replace *the entire line*
(man 5 header_checks) and you will lose information.

Search and replace arbitrary strings in the middle of a line is not part
of Postfix. It can be accomplished with a content_filter or milter, but
is NOT recommended as it may change things you do not intend.

"A better way"(tm) MAY be to PREPEND a header instead, i.e. "X-Tracking:
mail.sheltoncomputers.com"

Is this just a Received header or some other header?  If you wish more
help, more details are needed.

Brian

Reply via email to