Wietse Venema:
> Wietse Venema:
> > i...@itrezero.it:
> > > Good morning.
> > > Maybe I wasn't able to write a clear request :-( I'll try another way.
> > > 
> > > I've a set of IPs. I need to authenticate against each of them
> > > (useing different accounts on the same domain: us...@domain.com ,
> > > us...@domain.com , ) and want that emails are to be sent through
> > > the same IP.  For instance, if user1 makes authentication (I use
> > > Postfix + Dovecot for a pop3-before-smtp) using IP1, his emails
> > > must go out through IP1. The same with user2 on IP2, etc.  How can
> > > I reach this target?
> > 
> > To properly implement distinct MTA personalities, use one MTA per
> > IP address: http://www.postfix.org/MULTI_INSTANCE_README.html.
> > Unfortunately some (Linux) distributions tinker with Postfix and
> > unintentionally break multi-instance support.  You may have to shop
> > around or build from source.
> 
> To be clear, the following requires 2.7 or later.
> 
> > It is possible to implement a partial solution with master.cf overrides:
> > 
> >     # filter without nexthop, requires Postfix 2.7. 

This partial solution does not work if you need delivery to local
mailboxes. 

If you need local and remote deliveries, then the partial solution
is to use sender_dependent_default_transport_maps to select the
SMTP delivery method based on the sender envelope (MAIL FROM)
address, with "-o smtp_bind_address" overrides in master.cf to
select the Postfix SMTP client IP address.

Untested example:

/etc/postfix/master.cf:
    address1:smtp .. .. .. .. .. .. smtpd 
    address2:smtp .. .. .. .. .. .. smtpd
    smtp1 .. .. .. .. .. .. smtp -o smtp_bind_address=address1
    smtp2 .. .. .. .. .. .. smtp -o smtp_bind_address=address2

/etc/postfix/main.cf:
    sender_dependent_default_transport_maps = hash:/etc/postfix/sender_transport

/etc/postfix/sender_transport:
    @example1   smtp1
    @example2   smtp2
    @example3   dunno

        Wietse

Reply via email to