[Exim] Exim 3.36 as a Spamassassin Relay

Top Page
Delete this message
Reply to this message
Author: Matthew Daubenspeck
Date:  
To: exim-users
Subject: [Exim] Exim 3.36 as a Spamassassin Relay
I have a backup MX exim server that is working perfectly for a bunch of
domains. I would like to add spamassassin scanning for these backup
domains, and am having problems getting the config just right.
Spammassassin works locally on this machine, via the now famous dman
configs. This is the router that does the work for the other domains:

backup_routes:
driver = domainlist
transport = remote_smtp
search_type = lsearch
route_file = /etc/exim/backup_routes.conf

It forwards all mail in the domain list to the respective servers. If
the server cannot be reached, it is stuck in the retry queue. This works
perfectly. I then tried the following:

backup_routes:
  no_verify
  condition = "${if and { {!def:h_X-Spam-Flag:} \
               {!eq {$received_protocol}{spam-scanned}} \
           {!eq {$received_protocol}{local}} } {1}{0}}"
  driver = domainlist
  transport = spamcheck
  search_type = lsearch
  route_file = /etc/exim/backup_routes.conf


Which works, but only as long as the domain's main server is up. If the
server is down, I get caught in quite an ugly mail loop. Any ideas?