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
anyu...@mail.domain1.com it must send that email using mail.domain1.com
regardless what the From: content is. If it receives
anyu...@mail.domain2.com 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: anyu...@mail.domain2.com
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
an...@anvartay.com