Wietse Venema via Postfix-users:
> Wietse:
> > I asked for a copy of the (headers of the) resulting message that
> > Postfix delivers.
> > - Does it have a Received-SPF header?
> > - Does it have two?
> 
> Carlos Velasco:
> > 1. Deleting the header in the milter or doing nothing in the milter
> > has the same result: final email has only 1 Received-SPF header.
> > 
> > Received-SPF: Pass (mailfrom) identity=mailfrom;
> >    client-ip=2620:137:e000::1:20; helo=out1.vger.email;
> >    envelope-from=linux-kernel-ow...@vger.kernel.org; receiver=<UNKNOWN>
> > Received: from out1.vger.email (out1.vger.email
> >    [IPv6:2620:137:e000::1:20]) <-- *this is the own Received generated by 
> > postfix*
> 
> Thank you for showing concrete information.
> 
> It seems that the order of these headers is the problem.
> 
> The Postfix Milter implementation expects that the header order looks like:
> 
>     Received: from out1.vger.email ... (Postfix-generated)
>     Received-SPF: (and other Postfix-generated headers)
>     ...headers from remote SMTP client...
>     ...date/message-id/etc. headers that Postfix might add to an original 
> submission..
> 
> Unfortunatelty the PREPEND action will put the Received-SPF header
> BEFORE the Postfix-generated Received: header. And since the Postfix
> Milter implementation hides the first header, a Milter cannot delete
> that Received-SPF: header.
> 
> I'll do some tests to confirm that this is the problem.

Confirmed. A premiminary fix is below. This will prepend the
Received-SPF from the policy service after the Postfix-generated
Received: header and before the received message.

With this fix, a Milter can replace a PREMENDed Received-SPF: header
as one would expect.

This change is a bit invasive as it changes the message layout,
which is not needed if a configuration does not use Milters.

There is already code in place to hide the Postfix-generated Received:
header if it is not the first header. I''ll try to find as way 
to expose a prepended header even if it is before Received:.

        Wietse
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to