sender dependent relay host problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

sender dependent relay host problem

Marko Horn
hello list,

i want to seperate the sendout of mails for a specific doamain over 3
mailgateways i setup. it's a test scenario.

in the main.cf i set an entry like this:
sender_dependent_relayhost_maps =
hash:/etc/postfix/lookups/relayhost/sender_relay

sender_relay =

@testdomain.de         fsmtp:[192.168.100.186]:26

and in the master.cf

fsmtp   unix    -       -       n       -       -       smtp
         -o smtp_fallback_relay=[192.168.100.188]:26,[192.168.100.190]:26


when i send a mail with an account of @testdomain.de  the
sender_dependent_relayhost_map seems to work
but in the next step something goes wrong.
The error message is not clear enough for me.

in the log i get:

postfix/smtp[5164]: fatal: valid hostname or network address required in
server description: fsmtp:[192.168.100.186]:26
postfix/qmgr[4869]: warning: private/smtp socket: malformed response
postfix/qmgr[4869]: warning: transport smtp failure -- see a previous
warning/fatal/panic logfile record for the problem description
postfix/master[4524]: warning: process /usr/libexec/postfix/smtp pid
5164 exit status 1
postfix/master[4524]: warning: /usr/libexec/postfix/smtp: bad command
startup -- throttling
postfix/error[5167]: 82FD2400AA2A: to=<[hidden email]>, relay=none,
delay=1.5, delays=0.26/1.1/0/0.13, dsn=4.3.0, status=deferred (unknown
mail transport error)


what is wrong in my cronstruct?
anyone has a tipp or hint or can see the mistake in my config?

thank you

marko



--
Mitten drin statt nur Datei!
Reply | Threaded
Open this post in threaded view
|

Re: sender dependent relay host problem

Wietse Venema
Marko Horn:
> hello list,
>
> i want to seperate the sendout of mails for a specific doamain over 3
> mailgateways i setup. it's a test scenario.
>
> in the main.cf i set an entry like this:
> sender_dependent_relayhost_maps =
> hash:/etc/postfix/lookups/relayhost/sender_relay

This table requires HOST syntax.

> sender_relay =
>
> @testdomain.de         fsmtp:[192.168.100.186]:26

But you are using TRANSPORT:HOST syntax.

sender_dependent_relayhost_maps requires HOST syntax.
sender_dependent_default_transport_maps requires TRANSPORT:HOST syntax.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: sender dependent relay host problem

Marko Horn
hello wietse,

---
Mitten drin statt nur Datei!

Am 2020-09-30 16:12, schrieb Wietse Venema:

> Marko Horn:
>> hello list,
>>
>> i want to seperate the sendout of mails for a specific doamain over 3
>> mailgateways i setup. it's a test scenario.
>>
>> in the main.cf i set an entry like this:
>> sender_dependent_relayhost_maps =
>> hash:/etc/postfix/lookups/relayhost/sender_relay
>
> This table requires HOST syntax.
>
>> sender_relay =
>>
>> @testdomain.de         fsmtp:[192.168.100.186]:26
>
> But you are using TRANSPORT:HOST syntax.
>
> sender_dependent_relayhost_maps requires HOST syntax.
> sender_dependent_default_transport_maps requires TRANSPORT:HOST syntax.
>
> Wietse

thanks for showing me the mistake in my configuration.
with 'sender_dependent_default_transport_maps it works.

is it possible with postfix to use the the 3 mailgateways with 'round
robin'?

marko
Reply | Threaded
Open this post in threaded view
|

Re: sender dependent relay host problem

Wietse Venema
Wietse:
> sender_dependent_relayhost_maps requires HOST syntax.
> sender_dependent_default_transport_maps requires TRANSPORT:HOST syntax.
 
Marko Horn:
> thanks for showing me the mistake in my configuration.
> with 'sender_dependent_default_transport_maps it works.
>
> is it possible with postfix to use the the 3 mailgateways with 'round
> robin'?

sender_dependent_default_transport_maps =
        randmap:{xxx, yyy, zzz}

with xxx, yyy, zzz in TRANSPORT:HOST form. Each will be selected
with probability 1/3. If one should get more load, repeat the name.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: sender dependent relay host problem

Marko Horn
hello wietse,

---
Mitten drin statt nur Datei!

Am 2020-10-01 00:06, schrieb Wietse Venema:

> Wietse:
>> sender_dependent_relayhost_maps requires HOST syntax.
>> sender_dependent_default_transport_maps requires TRANSPORT:HOST
>> syntax.
>
> Marko Horn:
>> thanks for showing me the mistake in my configuration.
>> with 'sender_dependent_default_transport_maps it works.
>>
>> is it possible with postfix to use the the 3 mailgateways with 'round
>> robin'?
>
> sender_dependent_default_transport_maps =
> randmap:{xxx, yyy, zzz}
>
> with xxx, yyy, zzz in TRANSPORT:HOST form. Each will be selected
> with probability 1/3. If one should get more load, repeat the name.
>
> Wietse

sorry to bother you again..

is it the right i am doing it?:


sender_dependent_relayhost_maps =
hash:/etc/postfix/lookups/relayhost/sender_relay

sender_relay:
-------------
@testdomain.de     fsmtp:



main.cf:
--------
sender_dependent_default_transport_maps =
         
randmap:{fsmtp:[192.168.100.186]:26,fsmtp:[192.168.100.186]:26,fsmtp:[192.168.100.186]:26,fsmtp:[192.168.100.188]:26,fsmtp:[192.168.100.188]:26,fsmtp:[192.168.100.188]:26,fsmtp:[192.168.100.190]:26,fsmtp:[192.168.100.190]:26,fsmtp:[192.168.100.190]:26}


master.cf:
----------
fsmtp   unix    -       -       n       -       -       smtp
#       -o
smtp_fallback_relay=[192.168.100.186]:26,[192.168.100.188]:26,[192.168.100.190]:26


but the mails are not really going out in round robin. mostly 10-12
times thru same mailgateway.

do i have to set the following settings to get it better distributed?

smtp_connection_reuse_count_limit = 2
smtp_connection_reuse_time_limit = 2s
smtp_connection_cache_on_demand = no

Reply | Threaded
Open this post in threaded view
|

Re: sender dependent relay host problem

Wietse Venema
Marko Horn:
> sender_dependent_relayhost_maps =
> hash:/etc/postfix/lookups/relayhost/sender_relay
>
> sender_relay:
> -------------
> @testdomain.de     fsmtp:

sender_dependent_relayhost_maps requires a HOST, not a TRANSPORT.
But it does not matter, because the postconf(5) manpage says:

    This information is overruled with relay_transport,
    SENDER_DEPENDENT_DEFAULT_TRANSPORT_MAPS, default_transport and
    with the transport(5) table.

> sender_dependent_default_transport_maps =
>          
> randmap:{fsmtp:[192.168.100.186]:26,fsmtp:[192.168.100.186]:26,fsmtp:[192.168.100.186]:26,fsmtp:[192.168.100.188]:26,fsmtp:[192.168.100.188]:26,fsmtp:[192.168.100.188]:26,fsmtp:[192.168.100.190]:26,fsmtp:[192.168.100.190]:26,fsmtp:[192.168.100.190]:26}
>
>
> master.cf:
> ----------
> fsmtp   unix    -       -       n       -       -       smtp
> #       -o
> smtp_fallback_relay=[192.168.100.186]:26,[192.168.100.188]:26,[192.168.100.190]:26
>
>
> but the mails are not really going out in round robin. mostly 10-12
> times thru same mailgateway.

Which gateway?

And if you send 20 messages, will 10-12 be sent to the
same gateway? Where do the other messages go to?

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: sender dependent relay host problem

Marko Horn

hello wietse,
---
Mitten drin statt nur Datei!

Am 2020-10-08 21:28, schrieb Wietse Venema:

> Marko Horn:
>> sender_dependent_relayhost_maps =
>> hash:/etc/postfix/lookups/relayhost/sender_relay
>>
>> sender_relay:
>> -------------
>> @testdomain.de     fsmtp:
>
> sender_dependent_relayhost_maps requires a HOST, not a TRANSPORT.
> But it does not matter, because the postconf(5) manpage says:
>
>     This information is overruled with relay_transport,
>     SENDER_DEPENDENT_DEFAULT_TRANSPORT_MAPS, default_transport and
>     with the transport(5) table.
>
>> sender_dependent_default_transport_maps =
>>
>> randmap:{fsmtp:[192.168.100.186]:26,fsmtp:[192.168.100.186]:26,fsmtp:[192.168.100.186]:26,fsmtp:[192.168.100.188]:26,fsmtp:[192.168.100.188]:26,fsmtp:[192.168.100.188]:26,fsmtp:[192.168.100.190]:26,fsmtp:[192.168.100.190]:26,fsmtp:[192.168.100.190]:26}
>>
>>
>> master.cf:
>> ----------
>> fsmtp   unix    -       -       n       -       -       smtp
>> #       -o
>> smtp_fallback_relay=[192.168.100.186]:26,[192.168.100.188]:26,[192.168.100.190]:26
>>
>>
>> but the mails are not really going out in round robin. mostly 10-12
>> times thru same mailgateway.
>
> Which gateway?
>
> And if you send 20 messages, will 10-12 be sent to the
> same gateway? Where do the other messages go to?
>
> Wietse

at teh beginning,
sorry to get on nervs ....

i was a time not able to work further on the mail project but restarting
now.
when look at the last posts to this topic i realized , i have overseen
the little but important difference between two config varaibles:

SENDER_DEPENDENT_DEFAULT_TRANSPORT_MAPS &
sender_dependent_relayhost_maps

better i start at the beginning:

on my psotfix machine at example i have 2 domains =  test-1.de &
test-2.de

i setup for test 3 Mailout-Gateways.

test-1.de should NOT go thru these 3 mailout-gateways

test-2.de should GO thru these 3 mailout-gateways...

BUT, i want to distribute the test-2.de mail to the 3 mailout-gateways
by round robin.
(there you told me from  randmap)

IF, one of these mailout-gateway is down postfix should recognize this
and use the left 2 mailout-gateways.

i dont get it at all how to do this. is it possible to do so?


kind regards
marko


















Reply | Threaded
Open this post in threaded view
|

Re: sender dependent relay host problem

Wietse Venema
Marko Horn:
> better i start at the beginning:
>
> on my psotfix machine at example i have 2 domains =  test-1.de &
> test-2.de

You are using one Postfx system to SEND email with a sender address
in one of two domains.

> i setup for test 3 Mailout-Gateways.
>
> test-1.de should NOT go thru these 3 mailout-gateways

The Postfix machine should send that email directly to the recipient's
mail server.

> test-2.de should GO thru these 3 mailout-gateways...

The same Postfix machine should send mail from the second domain
through three gateways.

> BUT, i want to distribute the test-2.de mail to the 3 mailout-gateways
> by round robin.

Unfortunately this cannot use

    sender_dependent_xxx_maps = randmap:{...}

because that would send all messages through the three gateways.

Solution 1: use a fake multi-address gateway:

sender_dependent_default_transport_maps =
    inline:{{@test-2.de = smtp:gateways.example.com}}

Where gateways.example.com has three IP addresses in DNS or in
/etc/hosts (the second variant requires "smtp_host_lookup = dns, native").

The Postfix SMTP client will try all three IP addresses in random order,
if the sender domain is test-2.de, otherwise it will use the default
setting (default_transport = smtp) and send mail directly.

Other solutions involve "sender_dependent_default_transport_maps =
tcp_table:..." or "sender_dependent_default_transport_maps =
socketmap:..." and are more painful to deploy,

        Wietse