Thanks a lot Viktor!

I wanted to make this to segment the wich server the message will be delivered 
because I have the problem:

Today I have 10 mail server and I have created a proxy for the domain to 
coexist between them. And create a postfix to clients connect and send message 
(Previous mail)

But now when the message is arrived by the Postfix (called msa-proxy) it just 
check the user in active directory and send the message.

All mail server have a virtual-mta to delivery mail with 3 ips.
When a users send message via email client(msa-proxy) all the 10 servers will 
be sent message with just 3 IPs and the queue increases


Like you tell: "This is rather complex" I'm sure ?

________________________________
De: owner-postfix-us...@postfix.org <owner-postfix-us...@postfix.org> em nome 
de Viktor Dukhovni <postfix-us...@dukhovni.org>
Enviado: terça-feira, 25 de abril de 2017 12:48:06
Para: Postfix users
Assunto: Re: Write a personalized header


> 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