Am 15.01.2012 19:09, schrieb Andrew Beverley:
> On Sun, 2012-01-15 at 12:15 -0500, Wietse Venema wrote:
>> 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.
> 
> Thanks for the reply. I did previously submit over SMTP, but thought
> that it was better to use the sendmail command, as it accepts mail even
> if the daemon isn't running for whatever reason.
> 
>>> 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.
> 
> No problem, that's understandable.
> 
>> 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.
> 
> Presumably this depends on the sender address? I could probably do this,
> but I can see that it would get a bit messy in my circumstances.
> 
>> 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.
> 
> Sorry, I should have explained. I run a bunch of mailing lists, and use
> different IP addresses for different mailing lists (amongst other
> things). Everything runs from Perl scripts, 

perhaps this helps, if you can wrap it somehow in your scripts

http://caspian.dotconf.net/menu/Software/SendEmail/

-b local host bind address


so the script needs to
> specify which IP address to use as it sends the email. I'd rather avoid
> the sender address dictating which IP address to use, because I'd like
> the flexibility to specify the IP address in the script on the fly for
> other parameters.
> 
> Thanks,
> 
> Andy
> 
> 


-- 
Best Regards

MfG Robert Schetterer

Germany/Munich/Bavaria

Reply via email to