Tille - I can see you, read those man pages!   Tille's Site

My Mail Server Configuration

Components

  • System: Debian Woody
  • Packages (installed with apt-get):

    • MTA: postfix 1.1.11-0
    • Delivery: cyrus22-common, cyrus22-imapd, cyrus22-pop3d 2.2.10-1
    • Scanning: amavisd-new 20030616p10-4, spamassassin 3.0.1-0, clamav 0.80-6

(see below for more on Sarge.)

Setup

Debian has very good documentation for its packages in /us/share/doc, which I followed for the largest part.

These are the settings that I changed because the defaults were not sufficient:

  • Cyrus imapd uses case sensitive mailboxes, thus breaking a lot of dependencies. To make it use case insensitive mailboxes, I changed the settings for the cyrus delivery agent in /etc/postfix/master.cf:

    cyrus     unix  -       n       n       -       -       pipe
      flags=Ru user=cyrus argv=/usr/sbin/cyrdeliver -e -m ${extension} ${user}
    

    You need the Ru flags.

    /usr/share/doc/amavisd-new/README.postfix.gz tells you what you have to add to the master.cf file to support Amavis.

  • For testing purposes, I added this to the /etc/postfix/main.cf file:

    soft_bounce=yes
    

    And for using Amavis this (it was in the docs):

    content_filter=smtp-amavis:[127.0.0.1]:10024
    
  • In /etc/amavis/amavisd.conf I entered my domain name in the appropriate places, and I told it to use Postfix:

    $forward_method = 'smtp:127.0.0.1:10025';
    $notify_method = $forward_method;
    

    The @bypass_spam_checks_acl remains commented or Amavis does not contact SpamAssassin. The rest is in the docs.

  • In /etc/spamassassin/local.cf I added the following:

    rewritte_subject 1
    lock_method flock
    use_razor 1
    

    There was nothing there before, this is appearantly all you need.

Note: older package versions have different config files, make sure that you have the most recent versions of all packages. Almost all the problems I encountered where due to old packages that were incompatible with eachother.

To upgrade spamassassin to 3.1.*

Recently (well, not that recently) I upgraded to Debian Sarge. But spamassassin was still the same version (more or less) as on Woody. So I was using outdated filter rules. Spammers do not rest, so the standard install is not enough.

In the newer 3.1.* versions of spamassassin, other configuration files are used. Upgrading on Debian proved to be rather badly documented. This is what I needed to do:

/etc/apt/preferences: add this block

Package: *
Pin: release a=sarge-sloppy
Pin-Priority: 1001

/etc/apt/sources.list: add these lines:

deb http://volatile.debian.net/debian-volatile sarge/volatile main contrib non-free
deb http://volatile.debian.net/debian-volatile sarge/volatile-sloppy main contrib non-free

man 5 apt_preferences explains about priorities.

Check with apt-cache policy spamassassin that the Candidate is the correct version, i.e. something with the string volatile in its name.

Now install the spamassassin package again. Replace existing config files with the new ones.

See also debian-volatile-archives for more explanations about why spamassassin needs this treatment, and the debian-volatile website.

System-wide learning

My guess:

The path of an incoming mail:

postfix -> amavis -> spamassassin -> amavis -> postfix -> cyrus -> my INBOX

As amavis forms the link between spamassassin and the rest of the chain, the amavis user should be configured to use sa-learn. So all users should be told to drop their ham and spam in some place, and then amavis' crontab file can be configured to read these mails periodically.

Home
© 1995-2010 Machtelt Garrels - tille - Powered by vIm - Best viewed with your eyes - Validated by W3C - Last update 20100511