LINUX.ORG.RU

Избранные сообщения YuraI

Postfix header_checks

Форум — Admin

Здравствуйте! Есть вот такая проблема. Вот исходник письма:

Delivered-To: user@gmail.com 
Received: by 10.36.69.68 with SMTP id y65csp999344ita; 
        Fri, 20 Feb 2015 02:42:22 -0800 (PST) 
X-Received: by 10.180.88.193 with SMTP id bi1mr23250160wib.70.1424428941729; 
        Fri, 20 Feb 2015 02:42:21 -0800 (PST) 
Return-Path: <root@localhost.localdomain> 
Received: from localhost.localdomain (static.10.10.10.10.clients.your-server.de. [10.10.10.10]) 
        by mx.google.com with ESMTP id jh6si1867719wid.94.2015.02.20.02.42.21 
        for <user@gmail.com>; 
        Fri, 20 Feb 2015 02:42:21 -0800 (PST) 
Received-SPF: none (google.com: root@localhost.localdomain does not designate permitted sender hosts) client-ip=10.10.10.10; 
Authentication-Results: mx.google.com; 
       spf=none (google.com: root@localhost.localdomain does not designate permitted sender hosts) smtp.mail=root@localhost.localdomain 
Received: by local_mail_server (Postfix, from userid 0) 
   id E7AFE8943B; Fri, 20 Feb 2015 02:42:20 -0800 (PST) 
To: user@gmail.com 
Subject: test 
Message-Id: <20150220104220.E7AFE8943B@localhost.localdomain> 
Date: Fri, 20 Feb 2015 02:42:20 -0800 (PST) 
From: root@localhost.localdomain (root) 

/root
Например заменить «Received: by »
/^Received: by .*(wi.*)/ REPLACE Received: by 10.0.0.10 ${1}
для

Received: by 10.36.69.68 with SMTP id y65csp999344ita; Fri, 20 Feb 2015 02:42:22 -0800 (PST)

Не работает, если пробовать постмапом, то с регуляркой все ок

postmap -q 'Received: by 10.36.69.68 with SMTP id y65csp999344ita;        Fri, 20 Feb 2015 02:42:22 -0800 (PST)' pcre:/etc/postfix/header_checks 
REPLACE Received: by 10.0.0.10 with SMTP id y65csp999344ita;        Fri, 20 Feb 2015 02:42:22 -0800 (PST)
/^Received: by mydomain\.localdomain (.*)$/  REPLACE Received: by local_mail_server ${1}
для

Received: by local_mail_server (Postfix, from userid 0) id E7AFE8943B; Fri, 20 Feb 2015 02:42:20 -0800 (PST)

Работает

В чем причина, подскажите пожалуйста. И реально ли подменить хэдер тот который первый?

Спасибо!

 ,

YuraI
()