Am 07.11.2016 um 16:11 schrieb Jan Johansson:
Hello!

problably a silly question, but I cannot seem to find an example of obtaining 
transport mapping via mySQL. Is that even possible?
(CentOS 7 with 2:2.10.1-6.el7)


It's actually quite simple:
1) Create a file with the MySQL credentials and the query
2) Include the created file in transport_maps within main.cf

/etc/postfix/mysql_relay_transport_maps.cf
        user = dbuser
        password = dbpass
        dbname = maildb
        hosts = unix:/var/run/mysqld/mysqld.sock
        query = SELECT transport FROM domain WHERE domain = '%s'

/etc/postfix/main.cf
    transport_maps =
        btree:/etc/postfix/transport_maps,
        proxy:mysql:/etc/postfix/mysql_relay_transport_maps.cf

--
Alex JOST

Reply via email to