Thanks once again!

Do you see any possibility to use the client IP from the XFORWARD header? And to pass it to an external policy daemon?

Amda

On 09.03.2016 22:41, Wietse Venema wrote:
gsotsas:
Dear postfix users,
I have the following outbound relayhost configuration:
{client that sends mail to smtp relay} -> {postfix:587} -> {policyd} ->
{postfix} -> {amavis:10024} -> {postfix:10025} -> {postfix relays mail
to destination mailserver}

What I need is that the last postfix process sets smtp_bind_address (or
outgoing transport map) depending on the client IP.
That will be difficult. You can choose the Postfix SMTP client by
sender email address with sender_dependent_default_transport_maps,
but choosing it by client IP address will involve fragile hacks:

Before content filter, an check_Client_access map with

     /^[0-9.]+$/ PREPEND X-Client: $1

After the content filter, a header_checks action with:

     /^X-Client: ([0-9.]+)/     FILTER smtp-$1:

And master.cf entries with:

     smtp-1.2.3.4 .. .. .. .. .. .. smtp -o smtp_bind_address=1.2.3.4

        Wietse

Is there any way to achieve this (maybe with an external plugin or
something)?

I know aboutsender_dependent_default_transport_maps but this only works
with the envelope sender domain.
I know that postfix passess the original client ip to amavis as XFORWARD
header (smtp_send_xforward_command)- and amavis returns this header to
{postfix:10025}by specifyingsmtpd_authorized_xforward_hosts.
But the XFORWARD header is used only for logging purpose and cant be
used for my needs - or am I wrong?

Thank you in advance
Amda


Reply via email to