Marc Silver put forth on 11/10/2009 2:23 AM: > Hi, > > On Tue, 10 Nov 2009 09:03:56 +0200, Jack Knowlton <jknowl...@vp44.com> > wrote: >> Is it possible to have a transport map with a regular expression? What I >> want is to use an external relay server for all the emails to be >> delivered >> on Yahoo domains (eg, yahoo.com, yahoo.co.uk, yahoo.es, ecc). >> If it is possible, how can I implement this? > > I'm not an expert, but I believe this is possible by specifying your > transport file as "transport_maps=regexp:/etc/postfix/transport". You > may also use PCRE instead of regexp if you prefer. The only downside is > that the entire file needs to be set up in the regex/pcre fashion (as > far as I'm aware anyway).
There is no downside, except the possible need for multiple transport maps. He can have as many as he wants/needs, of all kinds, hash, pcre, regexp, dbm, etc: http://www.postfix.org/postconf.5.html transport_maps (default: empty) Optional lookup tables with mappings from recipient address to (message delivery transport, next-hop destination). See transport(5) for details. Specify zero or more "type:table" lookup tables. If you use this feature with local files, run "postmap /etc/postfix/transport" after making a change. For safety reasons, as of Postfix 2.3 this feature does not allow $number substitutions in regular expression maps. Examples: transport_maps = dbm:/etc/postfix/transport transport_maps = hash:/etc/postfix/transport Instructions above tell us to use postmap on the file after any changes. I think that assumes one is using hash, not any other maps types. Check the use cases for postmap, as you dont use it on regexp or pcre maps, but do use it on hash maps. I'm not sure WRT dbm maps as I've never used them. -- Stan