Spamschutz

  1. aptitude install spamassassin spamc razor pyzor
    groupadd -g 501 spamd
    useradd -u 501 -g 501 -s /sbin/nologin -d /home/spamd spamd
  2. /etc/default/spamassassin:
    # /etc/default/spamassassin
    # Duncan Findlay
    
    # WARNING: please read README.spamd before using.
    # There may be security risks.
    
    # Change to one to enable spamd
    ENABLED=1
    
    # Options
    # See man spamd for possible options. The -d option is automatically added.
    
    # SpamAssassin uses a preforking model, so be careful! You need to
    # make sure --max-children is not set to anything higher than 5,
    # unless you know what you're doing.
    
    OPTIONS="--create-prefs --max-children 5 --username spamd --helper-home-dir"
    
    # Pid file
    # Where should spamd write its PID to file? If you use the -u or
    # --username option above, this needs to be writable by that user.
    # Otherwise, the init script will not be able to shut spamd down.
    PIDFILE="/var/run/spamd.pid"
    
    # Set nice level of spamd
    NICE="--nicelevel 15"
    
    # Cronjob
    # Set to anything but 0 to enable the cron job to automatically update
    # spamassassin's rules on a nightly basis
    CRON=0
  3. /etc/spamassassin/local.cf:
    ...
    #pyzor
    use_pyzor 1
    pyzor_path /usr/bin/pyzor
    
    #razor
    use_razor2 1
    razor_config /etc/razor/razor-agent.conf
    
    #bayes
    use_bayes 1
    use_bayes_rules 1
    bayes_auto_learn 1
    ...
  4. /etc/postfix/master.cf:
    ...
    smtp      inet  n       -       -       -       -       smtpd
       -o content_filter=spamassassin
    ...
    spamassassin unix - n n - - pipe
      user=spamd argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
     
  5. /etc/init.d/spamassassin start