Hi Postfix users,

I'm configuring a postfix server in an environment with no access to
DNS, and I'd like it to be able to load balance between relay
addresses listed in /etc/hosts. While I could run a lightweight DNS
server on the machine, I'd prefer not to add that complexity if it can
be avoided.

Selected postconf:
mail_version = 2.7.0
disable_dns_lookups = yes
relayhost = [relay.local]

In /etc/host.conf:
multi on

In /etc/hosts:
1.1.1.1 relay.local
2.2.2.2 relay.local
3.3.3.3 alt-relay.local
4.4.4.4 alt-relay.local

Getaddrinfo appears to return both addresses:
$ python -c 'import socket; print socket.getaddrinfo("relay.local",
25, socket.AF_INET, socket.SOCK_STREAM)'
[(2, 1, 6, '', ('1.1.1.1', 25)), (2, 1, 6, '', ('2.2.2.2', 25))]
$ ./getaddrinfo relay.local
Hostname:       relay.local
Addresses:      1.1.1.1 2.2.2.2

But postfix only tries 1.1.1.1. I've set 1.1.1.1 to a blackhole
address, in which case the mail does not go through.

I tried adding:
smtp_fallback_relay = [alt-relay.local]

This causes postfix to retry with 3.3.3.3, but even if 3.3.3.3 is
blackholed, it has not yet tried 4.4.4.4.

Is there some other directive I am missing? Is this behavior by design?

Thanks,
Andy

Reply via email to