My mail server is protected from spam by our Barracuda appliance. I'm trying to configure EXIM to forward ALL outbound messages to the Barracuda server first, including mail for local domains. Once the messages are scanned and allowed, the Barracuda server will then deliver local mail back to my mail server where the EXIM config will allow them to be delivered. I believe I can achieve this with a conditional definition for the "domains =" portion of the config below ,but I'm unsure of the sytax:
RoutetoBarracuda:
driver = manualroute
domains = ?
transport = remote_smtp
route_list = * barracuda.mydomain.com
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
no_more
Can I write an "if/else" statement for "domains" where (in plain English):
domains = ! +local_domains (everything but local domains) if the sender is my Barracuda server else * (forward all domains to Barracuda) if the sender is any other host/IP address.
Since I can't trust my users to not spam each other, the desired action is to have EXIM forward local to local mail from a sender off to the Barracuda server first and recognize when it comes back, so that it can then be delivered locally.
I hope this question makes sense. I'm unsure about the syntax to make above work.
Feel free to let me know if there's a better way to do this.