The Monday 2005-01-24 at 11:33 -0600, Danny Sauer wrote:
You use /etc/postfix/transports for choosing a transport based on destination address, and can specify said destination address either as a full address (user@do.main) or just a domain (do.main or .do.main). You can only select a transport based on the recipient address, though, not the sender address. AFAIK.
I thought so, but I also thought I had heard somewhere that more complex rules could be used. You see, it can also make sense to choose a different transport based on the from address, similarly to what a MUA does.
If you want to send to a different relay based on what ISP you're connected through, you'll have to set up a script that changes the default transport (or the whole transport map) each time you connect. What *I* would do in that situation, presuming Carlos wants to be just like me, is to make a transport map for each ISP I connect though, and another transport map that has things that are common to both ISPs. So, I've now got transport, transport_ISP1, and transport_ISP2 in /etc/postfix. Then, in my post-connect script for ISP1, I'd run postconf -e "transport_maps=hash:/etc/postfix/transport,\ hash:/etc/postfix/transport_ISP1" postfix reload and similarly for ISP2. That way, my global transport settings are preserved for both ISPs (/etc/postfix/transport), and the map for per-ISP settings are added depending on who I'm connected through.
Ah, that is in the line of what I was thinking about. I was thinking of having two maps, and symlink the right one to "transport" at connect time, and run postmap and reload. This could be done from the /etc/ppp/ip-up.local script, which is run with root privileges. I only need to learn the name of the provider there. But the only parameters the script is fed with are: interface-name tty-device speed local-IP-address remote-IP-address ipparam The last one could be used for this: ipparam string Provides an extra parameter to the ip-up and ip-down scripts. If this option is given, the string supplied is given as the 6th parameter to those scripts. For that, I would have to convince wvdial to supply that parameter to the pppd daemon. Otherwise, if an arbitrary command could be run from wvdial, that would be it as well. If not, then I'll have to use a wrapper script to call wvdial, and I already do. I'll need to modify that one further...
Make sure the global one is listed first, and check out the man page for "transport".
--Danny, who likes postfix
Me too. -- Cheers, Carlos Robinson