transport_maps

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

transport_maps

Volodymyr.Lytvynenko@ukrsotsbank.com
Hi.  I have next transport_maps in main.cf:
/etc/postfix/main.cf:
    transport_maps = pipemap:{
        inline:{unicredit.ua=x, ukrsotsbank.com=x},
        randmap:{smtp:[mx1.ukrsotsbank.com], smtp:[mx2.ukrsotsbank.com]}
    }

How can I add another domain to the another randmap destinations ?

------------------------------------------------------------
Best regards,
Vladimir Litvinenko

SSO Delivery Technical Support Specialist "IT Innovations Ukraine" Ltd.
Reply | Threaded
Open this post in threaded view
|

Re: transport_maps

Viktor Dukhovni

> On May 4, 2017, at 8:31 AM, [hidden email] wrote:
>
> transport_maps = pipemap:{
> inline:{unicredit.ua=x, ukrsotsbank.com=x},
> randmap:{smtp:[mx1.ukrsotsbank.com], smtp:[mx2.ukrsotsbank.com]}
>    }
>
> How can I add another domain to the another randmap destinations ?

The transport_maps parameter takes a list of tables, so you could append
another pipemap to the list that handles the additional domain that uses
a different list of smtp nexthop values.  However, I think this is a fairly
clumsy way of doing MX load-balancing.  Instead I would:

  * Run a local DNS resolver on the MTA listening for requests on the loopback
    address (127.0.0.1) and configured with an local data for the
    "localhost" TLD (https://tools.ietf.org/html/rfc2606#section-2)

  * Configure /etc/resolv.conf to use only the local (127.0.0.1) resolver.

  * Configure the resolver (BIND syntax) to serve:

        unicredit.ua.localhost. IN MX 0 mx1.ukrsotsbank.com.
        unicredit.ua.localhost. IN MX 0 mx2.ukrsotsbank.com.
        ;
        ukrsotsbank.com.localhost. IN MX 0 mx1.ukrsotsbank.com.
        ukrsotsbank.com.localhost. IN MX 0 mx2.ukrsotsbank.com.
        ;
        # More domains with arbitrary custom MX hosts

  * Configure a regular file-based transport table as follows:

  transport:
        # RHS values without [] around an smtp nexthop do MX lookups
        unicredit.ua smtp:unicredit.ua.localhost
        ukrsotsbank.com smtp:ukrsotsbank.com.localhost
        ...

Don't forget to postmap the table after it changes and set:

    main.cf:
        indexed = ${default_database_type}:${config_directory}/
        transport_maps = ${indexed}transport

--
        Viktor.