On Wed, Dec 29, 2010 at 15:43, Victor Duchovni
<victor.ducho...@morganstanley.com> wrote:
> On Wed, Dec 29, 2010 at 03:33:43PM -0500, Phil Howard wrote:
>
>> As I understand header_checks, it removes only what is already in the
>> message.
>
> The header_checks(5) code is implemented by cleanup(8) which processes
> the message passed to it by smtpd(8). The "Received" header that
> records the original client IP is added by smtpd(8) and is seen by
> cleanup(8). Therefore, this header can be removed via header_checks(5).

OK, sot it will apply to all headers after the instant one is added.
Now the issue remains how to match the one just added and not others
that existed before it ... even if those look exactly the same.  In
particular, I want to NOT remove any previous headers that try to
mimic these headers.  I want to ONLY remove the one being added.  I
want to be sure that any lookalikes that were in the original message
are retained.  Much of why I am doing this involves checking things
like mimic headers.  So the test that is needed is "was this header
added by amavis or the 2nd smtpd that gets mail back from amavis,
without considering the contents?".


> By crafting the check to match exactly the correct header. The two headers
> likely differ in detail. If necessary, you could set "mail_name" in the
> downstream or upstream Postfix, so that header_checks(5) can tell the
> two apart.

Likely, they will differ.  I'm sure the timestamps will.  But I don't
want to delete any headers that specify localhost, for example, even
though that is something that could match one of the inserted headers.
 So I can't match on things like that.


> This is not so difficult. Just a carefully crafted regular expression
> is sufficient.

It's not obvious to me given that content is not usable to match against.

-- 
sHiFt HaPpEnS!

Reply via email to