On Wed, Jul 10, 2013 at 10:32:19AM +0530, Ram wrote:
> I guess I understand that. But I think the requirement would be
> reasonable If I have 2 networks I may need to have different bind
> addresses.
The code that implements smtp_bind_address is in smtp_connect_addr()
in src/smtp/smtp_connect.c. The sensible implementation of what
you describe is a table lookup by nexthop destination that yields
the appropriate bind address. You'd need open the table in pre-jail
initialization in src/smtp/smtp.c.
main.cf:
indexed = ${default_database_type}:${config_directory}/
smtp_bind_address_maps = ${indexed}bind_addr
bind_addr:
ipv4:[smtp.example.net]:587 192.0.2.1
ipv6:[smtp.example.com]:587 2001:db8::1
The lookup key would be <protocol>:<nexthop>. Demand for this would
be relatively narrow. I am not sure this warrants a new feature in
the official Postfix release.
--
Viktor.