Once I already asked about this problem, but didn't get solution, so I am opening new thread.
Hope to get help from you guys.
So, my problem is:
I have Solaris 10 based server.
I have a script which should send mails using mailx (can use another if needed).
What I need is - mails which belongs to @AAA.com send to IP1 and mails which belongs to @BBB.com send to IP2 (I need to use different relays).
At the moment, script checking domain name to which mail belongs and changing file /etc/mail/sendmail.cf Smart Relay host each time each time, but this is workaround solution which is not good actually.
I tried to specify domains in /etc/mail/relay-domain in below format: