> On Apr 25, 2017, at 10:49 AM, Luis Miguel Flores dos Santos 
> <miguel_flores_san...@hotmail.com> wrote:
> 
> Hi, I have the transport_maps with hash to specify where serve messages will 
> be redirect.
> Can I save in header a result of the query in transport_maps each mail ?

No.  The Postfix queue file is becomes effectively read-only after the message 
is
received, but transport lookup happens later as mail is delivered.

The header can't be added until delivery time, because multi-recipient messages
will send different recipients via different transports.

> I want write this result "mailserver01.dominio.com" in the header.
> 
> Can postfix do it? 

Mostly no.  If you just need this for a very small set of relays, you could
use a dedicated smtp(8) transport for each one, and in the master.cf entry
for each specify an override for "smtp_header_checks" with a suitable
REPLACE or PREPEND action for some place-holder header that you prepend on
message receipt.

        /^X-Relayed-TBD:/ REPLACE X-Relayed-To: smtp1.example.com

while in the default smtp(8) transport for other destinations:

        /^X-Relayed-TBD:/ IGNORE

This is rather complex, and the relay name will be in the "Received"
header added by the receiving system, so it is rather unclear why you'd
want to go to all the trouble.  My advice is to not do this.

-- 
        Viktor.

Reply via email to