On Wed, Dec 31, 2008 at 05:38:33PM +0000, Andrew Hodgson wrote:

> I am trying to find the answer whether Postfix will support multiple
> smarthosts - i.e, sending to specific smarthosts, and if one fails, it
> will try to send to the next one in the list, or will just use any
> smart host in the list without issue?

Season to taste:

    /etc/postfix/main.cf:
        relayhost = example.com

    /etc/named.conf:
        options {
            directory "/var/named/data";
        };
        zone "example.com" in {
                type master;
                file "example.com";
        };

    /var/named/data/example.com
        $TTL 2D;

        @ IN SOA a.ns.example.com hostmaster.example.com (
                    1               ; Serial
                    10800           ; Refresh after 3 hours
                    3600            ; Retry after 1 hour
                    604800          ; Expire after 1 week
                    3600 )          ; Minimum TTL of 1 hour
        @ IN NS a.ns
        @ IN NS b.ns
        a.ns IN A 192.0.2.1
        b.ns IN A 192.0.2.2

        @ IN MX 0 a.mx
        @ IN MX 1 b.mx
        @ IN MX 2 c.mx

        a.mx IN A 192.0.2.3
        b.mx IN A 192.0.2.4
        c.mx IN A 192.0.2.5

Non-local mail is sent to "a.mx.example.com" if that fails, it is sent
to "b.mx.example.com" and finally "c.mx.example.com", or you can adjust
the MX preferences to be equal to get stastical load-balancing.

Alternatively, if all SMTP deliveries go to the smarthost, and you
don't want to or can't change DNS:

        relayhost = [a.mx.example.com]
        smtp_fallback_relay = [b.mx.example.com], [c.mx.example.com]

you can adjust the master.cf file to specify different SMTP fallback relay
lists for different (e.g. "smtp unix" vs. "relay unix") SMTP transports.

-- 
        Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:majord...@postfix.org?body=unsubscribe%20postfix-users>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.

Reply via email to