Thomas Trepper: > Hi all, > > I hope I am right here, I have the following problem and can't find a > solution so I would like to ask you for this: > > I have a server (ubuntu 8.04.3-server) with one network interface and two > IPs on it and on top one postfix (2.5.1 installation. I would like postfix > to relay to different relayshost per interface like this: > > interface 10.0.0.1 ----> relay to mx0.abc.com (depending on domains the > relay is accepting) > interface 10.0.0.2 ----> relay to mx0.xyz.com (just all) > > Does anbody know, if and how this might be possible?
There are many ways. First, there is no need to use multiple server IP addresses. Normally, people use a standard Postfix gateway configuration and choose the down-stream MX host based on the recipient address. http://www.postfix.org/STANDARD_CONFIGURATION_README.html#backup If you must insist on using multiple server IP addresses, Postfix 2.6 provides tools to manage multiple Postfix instances (each having their own relayhost etc. settings). With 2.5 you'd have to roll your own support. http://www.postfix.org/MULTI_INSTANCE_README.html Otherwise, you may be able to fake this with one Postfix instance and the content_filter command (content filters override relayhost). /etc/postfix/master.cf: 10.0.0.1:smtp .. .. .. .. .. .. smtpd -o content_filter=smtp:[mx0.abc.com] 10.0.0.2:smtp .. .. .. .. .. .. smtpd -o content_filter=smtp:[mx0.xyz.com] If you are trying to do clever things with Postfix on a multi-homed firewall with IP forwarding turned off, don't fall into this trap: http://www.postfix.org/postconf.5.html#inet_interfaces Wietse