I have a SendMail server. I want traffic going to "special" domains to be redirected to a different location. I've done that by essentially considering some domains "local" and using some simple routing logic:
1) If sending to special domains (e.g. DOMAINA.com or DOMAINB.com) send to 1.1.1.1.
dnl # define mail_hub to special route
define(`MAIL_HUB',`relay:[1.1.1.1]')dnl
dnl # define list of 'local' domains that will be forwarded to the mail hub
define(`confCW_FILE',`/etc/mail-tls/special_domains')dnl
2) Else send to 2.2.2.2
define(`SMART_HOST',`relay:[2.2.2.2]')dnl
That seems to work great. But now I have a requirement to complicate the logic:
1) If sending to special domains (e.g. DOMAINA.com or DOMAINB.com) and envelope sender is NOT sending from sender@mydomainexample.com, send to 1.1.1.1
2) Else send to 2.2.2.2
Is there an easy way to do this (without requiring a milter)?