Outgoing load balancing by DNS round-robin

Hello

if i set a hostname for the next hop in Djigzo which resolves to more
than one IP address does Djigzo/Java-Mail choose a random one for
every new connection or does it cache results and stick to one of them?

Regards

Andreas

Do you mean the next hop for the MTA config? If so, this is handled by
Postfix. Not sure how Postfix handles that. I guess it looks-up the IP
address for the next hop using the default resolver but I need to see
whether I can find more info. You are probably more experienced with
Postfix than I am so you might already know the answer.

Or, with next hop do you mean the next hop in config.xml (which by
default is set to the local Postfix running on 127.0.0.1)?

Kind regards,

Martijn Brinkers

···

On 01/-10/-28163 08:59 PM, lst_hoe02(a)kwsoft.de wrote:

if i set a hostname for the next hop in Djigzo which resolves to more
than one IP address does Djigzo/Java-Mail choose a random one for every
new connection or does it cache results and stick to one of them?

--
Djigzo open source email encryption

Zitat von Martijn Brinkers <martijn(a)djigzo.com>:

if i set a hostname for the next hop in Djigzo which resolves to more
than one IP address does Djigzo/Java-Mail choose a random one for every
new connection or does it cache results and stick to one of them?

Do you mean the next hop for the MTA config? If so, this is handled by
Postfix. Not sure how Postfix handles that. I guess it looks-up the IP
address for the next hop using the default resolver but I need to see
whether I can find more info. You are probably more experienced with
Postfix than I am so you might already know the answer.

Or, with next hop do you mean the next hop in config.xml (which by
default is set to the local Postfix running on 127.0.0.1)?

The next Hop from Djigzo point of view if not using *localhost*
Postfix for example. So is it possible to set "my.internal.relay"
instead of 127.0.0.1 and have a decent number of delivery threads to
hand of the mail to more than one IP address for failover or
load-balance. I'm aware that Postfix is able to do so, but it might be
useful to not spool the mail again on the same machine before handing
off.

Thanks

Andreas

···

On 01/-10/-28163 08:59 PM, lst_hoe02(a)kwsoft.de wrote:

Looking at the (James) code, it appears that a lookup is done for an A
record. The complete DNS reply is cached for as long as the TTL of the
DNS record says it's valid. The returned IP addresses are tried in
consecutive order until the message has been successfully delivered. It
seems that the IP addresses are not tried in random order. If DNS load
balancing is required, you should set the TTL to a low value to make
sure that the DNS result is not cached and see whether your DNS server
returns the IP addresses in random order.

The above observation has not been tested.

Note to others: the above is only relevant if you change the config.xml
file to send handled email (i.e., encrypted or decrypted) not to the
local Postfix instance but to some other external email server.

Kind regards,

Martijn Brinkers

···

On 01/-10/-28163 08:59 PM, lst_hoe02(a)kwsoft.de wrote:

Zitat von Martijn Brinkers <martijn(a)djigzo.com>:

On 01/-10/-28163 08:59 PM, lst_hoe02(a)kwsoft.de wrote:

if i set a hostname for the next hop in Djigzo which resolves to more
than one IP address does Djigzo/Java-Mail choose a random one for every
new connection or does it cache results and stick to one of them?

Do you mean the next hop for the MTA config? If so, this is handled by
Postfix. Not sure how Postfix handles that. I guess it looks-up the IP
address for the next hop using the default resolver but I need to see
whether I can find more info. You are probably more experienced with
Postfix than I am so you might already know the answer.

Or, with next hop do you mean the next hop in config.xml (which by
default is set to the local Postfix running on 127.0.0.1)?

The next Hop from Djigzo point of view if not using *localhost* Postfix
for example. So is it possible to set "my.internal.relay" instead of
127.0.0.1 and have a decent number of delivery threads to hand of the
mail to more than one IP address for failover or load-balance. I'm aware
that Postfix is able to do so, but it might be useful to not spool the
mail again on the same machine before handing off.

--
Djigzo open source email encryption