using two different sending domains and IP addresses on one postfix server

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

using two different sending domains and IP addresses on one postfix server

anvartay
Hello,

I am configuring postfix send only mail server with 2x sending domain
lets say mail.domain1.com and mail.domain2.com. I have configured almost
all the pieces main.cf master.cf and
sender_dependent_default_transport_maps in main.cf. But unfortunately I
cannot achieve to the result requested from me.

mail.domain1.com -> 1.1.1.1

mail.domain2.com -> 2.2.2.2

I need to configure postfix instance in a way that if it receives smtp
relay connection from IP 1.1.1.1 by authentication
[hidden email] it must send that email using mail.domain1.com
regardless what the From: content is. If it receives
[hidden email] authenticated mail to relay then it must send
using sending domain mail.domain2.com again regardless of the From:
address is. By following configuration I can send all emails from
mail.domain1.com by default and only if From: [hidden email]
then regardless of how I authorize I can send email from sending domain:
mail.domain2.com.

main.cf important parts are:

smtp_bind_address = 1.1.1.1
sender_dependent_default_transport_maps =
pcre:/etc/postfix/sdd_transport.pcre


contents of /etc/postfix/sdd_transport.pcre:

/@mail\.domain1\.com$/   transport1:
/@mail\.domain2\.com$/   transport2:


master.cf important part:

transport1  unix -       -       n       -       - smtp
           -o syslog_name=postfix-domain1-com
           -o smtp_helo_name=mail.domain1.com
           -o smtp_bind_address=1.1.1.1

transport2  unix -       -       n       -       -       smtp
           -o syslog_name=postfix-domain2-com
           -o smtp_helo_name=mail.domain2.com
           -o smtp_bind_address=2.2.2.2


I want to use transport1 if user uses mail.domain1.com as relay and use
transport2 if user uses mail.domain2.com. Any advices how to achieve that?

Best regards,

--
Anvar Kuchkartaev
[hidden email]



Reply | Threaded
Open this post in threaded view
|

Re: using two different sending domains and IP addresses on one postfix server

Wietse Venema
Anvar Kuchkartaev:
> Hello,
>
> I am configuring postfix send only mail server with 2x sending domain
> lets say mail.domain1.com and mail.domain2.com. I have configured almost

If you want multiple mail sending and receiving personalities, see
http://www.postfix.org/MULTI_INSTANCE_README.html

        Wietse