Andrew Beverley: > Hi, > > I currently use multiple Postfix instances to send email from my server > from different IP addresses. Each Postfix instance has its own master.cf > file in its own configuration directory, and I use the "-C" parameter of > the sendmail command to specify which one to use.
If you set the MAIL_CONFIG environment variable, you can submit mail with other programs, without having to use the "raw" sendmail interface. You could also use a "mini-sendmail" program that submits mail over SMTP to the right Postfix instance. > I was wondering whether there is a better way to do it, preferably with > a single Postfix instance and single configuration directory? I see that > multiple IP addresses can be specified in master.cf, but I can't see a > way to tell the sendmail command which one to use. I've looked at > smtp_bind_address in main.cf, but I'm not convinced that's the right > thing to use. The sendmail interface specifies sender and recipient, not the source IP address. I have extended this interface to choose the MTA instance, but I would not extend it to override MTA routing policies. Such things would create too many opportunities for mis-use. It is possible to kludge something together with sender_dependent_default_transport_maps. You can use this to dynamically choose the master.cf entry with the appropriate smtp_bind_address setting. You have not explained what problem you are trying to solve with different IP addresses for different mailings (does mail from the same sender address go out via different IP addresses?), so I won't try to optimize the response. Wietse > Should I just stick with multiple Postfix instances? > > Postfix version is 2.7.1 on Debian Squeeze. > > Thanks, > > Andy > > >