On 19.3.2016 15:53, /dev/rob0 wrote:
On Sat, Mar 19, 2016 at 03:34:28PM +0100, Istvan Prosinger wrote:
I've tried what you ask, this is what I got:

[root@email ~]# postmap -h -q - pcre:/etc/postfix/stamp.pcre < testheader

Received: from localhost (localhost [127.0.0.1])
         by email-test.server.com (Postfix) with ESMTP id 3qRyhf4pqCzKmYs
         for <ist...@email-test.server.com>; Sat, 19 Mar 2016 06:17:54 -0400
(EDT) Prepend X-DIYL-3qRyhf4pqCzKmYs
Received: from knox.prosinger.net (knox.prosinger.net [5.44.101.107])
         by email-test.server.com (Postfix) with ESMTPS id 3qRyhf0ChgzKmYq
         for <ist...@email-test.server.com>; Sat, 19 Mar 2016 06:17:52 -0400
(EDT) Prepend X-DIYL-3qRyhf0ChgzKmYq


I think that this means two hits. If so, what comes to my mind is
that these headers are not there yet, in the moment when the
stamper.pcre is called.

You apparently are using a post-queue content filter.

If you want the post-filter queue ID as your header, adjust the
expression to include "localhost \(localhost \[127\.0\.0\.1\]\)".

If you want the pre-filter queue ID as your header, exclude that part
from your expression.  Note, that's not foolproof, if you happen to
have something on localhost sending mail.

Perhaps a better idea is: only apply these header_checks before (or
after?) the filter.  See:

postconf.5.html#receive_override_options
postconf.5.html#cleanup_service_name


Thanks for the effort. At that stage the only intportant thing was to make the pattern the simplest possibble so I can see how it works, I have modified it similar to your suggestion now as it started working.

Istvan

Reply via email to