Lists Nethead: > > postfix-3.2.2 > > Case in question: > > transport_maps = hash:/usr/local/etc/postfix/transport, > ldap:/usr/local/etc/postfix/ldap-transport.cf > > I had the (possibly erroneous) belief that Postfix searches the tables > in the order given in main.cf and that the domain part is sufficient. > What we wanted to accomplish is, in the hash table which is the first > entry above > > example.com smtp:[a.host.somwhere]
It searches both tables for u...@example.com (email address) in the order given in main.cf, then it searches both tables for example.com (domain only) in the order given in main.cf. > So the question is, how can we set up the transport maps in a hash > file so that all mail for users in the example.com domain gets sent to > smtp:[a.host.somwhere] instead of the default entry which is below in > the hash file. Here is a trick to make the u...@example.com match the first table: transport_maps = pcre:/usr/local/etc/postfix/transport.pcre ldap:/usr/local/etc/postfix/ldap-transport.cf /usr/local/etc/postfix/transport.pcre /@example\.com$/ smtp:[a.host.somwhere] With this, Postfix will not send the 'domain only' queries to the PCRE table, but it would still send them to the LDAP table. Wietse