Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

header_checks handled differently for emails with more than one recipient?

3 views
Skip to first unread message

Hanspeter Kunz

unread,
Feb 22, 2008, 7:12:40 AM2/22/08
to
Hello,

I'm trying to rewrite received headers for SASL authenticated senders,
in order to avoid their mails being classified as SPAM when sending from
a dynamic IP.

I do this with:

header_checks = pcre:$pcre_dir/auth_received_header_anonymisation.pcre

This works fine, if there is only one recipient:

Received: from [192.168.2.111] (80-218-159-224.dclient.hispeed.ch
[80.218.159.224]) (Authenticated sender: hkunz) by nikolai.ifi.uzh.ch
(postfix) with ESMTP id 342302A6B2B for <hk...@ifi.uzh.ch>; Wed, 20 Feb
2008 18:07:17 +0100 (CET)

is rewritten to something like:

Received: from authenticated sender hkunz by nikolai.ifi.uzh.ch
(postfix) with ESMTP id 1069B2A6B31 for <hk...@ifi.uzh.ch>; Wed, 20 Feb
2008 18:16:46 +0100 (CET)

As soon as there are other recipients in cc: the received header it not
being rewritten. I looks as if the header_checks are not applied to such
emails, because if I use postmap -q on the received header of such an
email it is matched an rewritten correctly.

I would be grateful for any hints on why this occurs.

postfix version: 2.4.6 (on debian etch)

Many thanks,
Hanspeter


The 2 match/rewrite rules are:

# anonymise received headers for SASL-authenticated clients.
# note the host name ("by nikolai..."), which is in there on purpose.
/^Received: from (\[[.[:digit:]]{7,15}\] \([-._[:alnum:]]+
\[[.[:digit:]]{7,15}\]\))[[:space:]]+(.*)\(Authenticated sender:
([^)]+)\)[[:space:]]+by (nikolai\.ifi\.uzh\.ch) \(([^)]+)\) with
(E?SMTP) id ([A-F[:digit:]]+)[[:space:]]+for <([^>]+)>; (.*)/
REPLACE Received: from
authenticated sender $3 by $4 ($5) with $6 id $7 for <$8>; $9
/^Received: from (\[[.[:digit:]]{7,15}\] \([-._[:alnum:]]+
\[[.[:digit:]]{7,15}\]\))[[:space:]]+(.*)\(Authenticated sender:
([^)]+)\)[[:space:]]+by (nikolai\.ifi\.uzh\.ch) \(([^)]+)\) with
(E?SMTP) id ([A-F[:digit:]]+); (.*)/
REPLACE Received: from
authenticated sender $3 by $4 ($5) with $6 id $7; $8

0 new messages