Amavisd-new on Debian

  1. apt-get everything (amavis, clamav, razor, pyzor, dcc)

  2. add content_filter=lmpt-amavis:[]:10024 to postfix/main.cf. change the IP to if you installed postfix and amavisd-new on the same machine

  3. then add to postfix/master.cf two entries:

    • definition of lmpt-amavis:

      lmtp-amavis unix - - n - 2 lmtp
      -o lmtp_data_done_timeout=1200
      -o lmtp_send_xforward_command=yes
      -o disable_dns_lookups=yes
      -o max_use=20

    • ...and additional listening postfix's subprocess for mail messages coming back from amavis: inet n - n - - smtpd
      -o content_filter=
      -o local_recipient_maps=
      -o relay_recipient_maps=
      -o smtpd_restriction_classes=
      -o smtpd_client_restrictions=
      -o smtpd_helo_restrictions=
      -o smtpd_sender_restrictions=
      -o smtpd_recipient_restrictions=permit_mynetworks,reject
      -o mynetworks=,
      -o strict_rfc821_envelopes=yes
      -o smtpd_error_sleep_time=0
      -o smtpd_soft_error_limit=1001
      -o smtpd_hard_error_limit=1000
      -o smtp_send_xforward_command=yes
      if you listen on this IP for scanned messages from external Amavisd. If you process all of it on one machine, enter

  4. add clamav to amavis group as in /usr/share/doc/amavisd-new/README.Debian

  5. download initial SpamAssasin Bayes db (check Fortress Systems Ltd.) and chown amavis.amavis /var/lib/amavis/.spamassassin

  6. to amavis/conf.d/20-debian-defaults add permission for external postfix server (the gateway of incoming mail messages):

    @mynetworks = qw( )

  7. in the same file tune $sa_tag2_level_deflt:

    • make $sa_kill_level_deflt equal $sa_tag2_level_deflt

    • lower $sa_tag2_level_deflt as much as possible. The limit is when you don't receive spam, but legitimate emails also ends in quratantine. I think you can lower it to 3.5 after training Bayes database

    • set quotas, subject modification string and other maquillage

  8. clamav-daemon restart; clamavd-freshclam restart; amavid-new debug[-sa]


  1. clarify the text above

  2. add maintenance of quarantine and learning Spamassassin (Bayes tokens)

No comments: