On 1/28/2011 1:13 PM, Brian Evans - Postfix List wrote:
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.
This is fine as long as I know how to keep the other part of the line in a variable, like $1 or $3 and know how to put it all back together afterwards. Could someone help me with this, please?

Is there anything, for the headers, that is like sed?
--




Jerrale G.
SC Senior Admin

Reply via email to