Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

Postfix with spamassassin. Acts as an anti-spam gateway for a domain. Scans and then relays.

I want to take mail that has been tagged as spam by spamassassin, and send it to a different mail server than non-spam. Both servers will accept mail for the same domain, but one is just a quarantine. All addressing stays intact.

Therefore I need to get postfix or spamassassin to route spam to one server and ham to another server. How can I achieve this?

share|improve this question

If you are already using amavis to work along with your postfix setup. Read on spam_quarantine_to settings for amavisd. For clean emails you can probably use relay_host in postfix itself, or the clean_quarantine_to method in amavisd (I personally have not used it though), just stating that there is such an option there.

share|improve this answer
Thanks. I got it working using spampd (proxy daemon) and a postfix content filter. spampd acts as a before-queue filter and calls spamass. when finished it passes the mail back to postfix on a secondary listener and a header check is used. If there's a hit it uses a FILTER argument to send the mail somewhere else via smtp. Otherwise the mail goes out using the relay domain address specified in the transport map. – Jason Nov 4 '11 at 7:51

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.