>> config
>> faq
Hetzner RAID1
tell me
Copyright © Per Jessen, 2003-2006.
Unless otherwise indicated, verbatim
copying and distribution of this entire
article is permitted in any medium,
provided this notice is preserved.

apache Apache/2.2.17 (Linux/SUSE)

Spamassassin & Postfix

Sometime mid- to late-2002, we converted from Sendmail to Postfix (what a relief) and then decided to have a look at SpamAssassin - not that we have a major spam problem, but it might just make life a bit easier.

This is a brief description of how we installed SpamAssassin with Postfix - only published because it seems slightly different to the other few methods we've seen on the web.


What I am about to describe is almost straight from Postfix' FILTER_README. This README suggests 2 fairly different methods for integrating various filters with Postfix. I found method no. 2 to be the most desirable, although it did cause a headache or two getting it to work.


By now, mid-october 2003, the setup described has been in operation for about a year, and it has been improved on more than once. I wrote an addendum a few months back, in which I changed the setup quite significantly, and as I have recently also been able simplify the setup by eliminating smtpclient, I thought it was a good time to consolidate the two articles into one.

This is the updated article and/or howto.

What people say


To me, any comment on this article is incredibly encouraging. Even if you write to tell me it doesn't work, and that I'm full of s... (I might be tempted not to respond to the latter, but still). To you who have written already - your comments are much appreciated.

What people say

I'm not one to blow my own trumpet - much better to leave that to others. Here are a few select comments I have received:

  • this is by far the most optimal solution I have seen
  • Thanks for the much simplified Postfix/SA configuration. It's been a bear trying to find out how to integrate it the way you have.
  • Read your posted article (and addendum) on SpamAssassin and PostFix -- an excellent How-To -- thank you very much!
  • Anyways, thanks again for the super article, it was just what I was looking for.
  • It helped me a lot. In less than a minute my mail was being filtered.

Postfix setup

I won't go into all of our Postfix setup in detail. Suffice to say that our Postfix server serves a small company with a mixture of Windows and UNIX workstations and/or laptops. Volume-wise, we probably process 500-600 emails per day. And that traffic includes quite a few mailing-list subscriptions.

Main objectives

It will probably be easier to understand the setup if you first understand what our objectives were:

Our Postfix installation does a few different things:

  • A small amount of inbound email is polled using fetchmail and then passed on to Postfix for local delivery. Generally emails end up in mailboxes for subsequent POP3 delivery.
  • Local email exchange and mailbox manager
  • Staging or proxy server for outbound external email. All local emails are forwarded to our central Postfix server, where non-local emails are then relayed to our provider. Local email is not to be spam-checked.


All external mail, including mail polled by fetchmail, is delivered to external-mail:25 which resolves to the virtual address we assigned. The postfix smtp daemon listening at externalmail:25 applies the spamassassin content-filter to all mail. Internal mail is not spam-checked.



Continue here to go over the actual configuration

Last time this page was updated: Wednesday 22 September 2004 14:09 XHTML 1.1 Conformant! CSS2 Conformant!

Stop spam&virus for good - (International), (United Kingdom), (Switzerland) and (Denmark).