Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to redirect all spams (that weren't rejected outright) to mailbox of local user spam (i.e. deliver mail to spam user rather than to original local recipient).

I'm using sa-exim (exim 4 + spamassasin 3.2) on Debian (it's got its own exim4.conf.template convoluted config).

I've tried adding the following router (before exim's real_local):

  debug_print = "R: spams $local_part@$domain"
  driver = redirect
  condition = ${if def:h_X-Spam-Flag {1}{0}}
  domains = +local_domains
  data = spam@localhost

but it doesn't seem to be triggered at all.

share|improve this question
up vote 1 down vote accepted

Double check that the new router is being used by exim

grep spams /var/lib/exim4/config.autogenerated

Then do some debugging, something like:

cat message-with-header.txt | exim -bm -t -d+route

You should see it run through each router, so check if it runs yours and hopefully tell you why its not working (condition failed, earlier router already took the message, etc)

share|improve this answer

Using the following condition works fine for me:

  condition = "${if def:h_X-Spam-Flag: {yes}{no}}"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.