Installation:Debian:Amavis ClamAV

From PMWH2 - PHPMyWebHosting's official wiki
Revision as of 08:39, 11 February 2008 by Chris (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
up

On Debian GNU/Linux you need to install the following packages:

  • amavisd-new
  • unzip

On Debian GNU/Linux use this command to install all at once:

apt-get install amavisd-new unzip

Suggests:

  • spamassassin
  • clamav
  • clamav-daemon
  • lha
  • arj
  • unrar
  • zoo
  • nomarch
  • cpio
  • lzop

On Debian GNU/Linux use this command to install all at Suggests once:

apt-get install spamassassin clamav clamav-daemon lha arj unrar zoo nomarch cpio lzop

amavis.conf

In amavis.conf, use the default mysql setup in "Section V':

(should be in one line)

@lookup_sql_dsn = (
['DBI:mysql:database=PMWH2_DATABASE;host=localhost;port=3306', 'PMWH2_USER',
'PMWH2_PASSWORD'] );

(should be in one line)

$sql_select_policy = 'SELECT *,amavis_users.id FROM
amavis_users,amavis_policy'.
' WHERE (amavis_users.policy_id=amavis_policy.id) AND
(amavis_users.email IN (%k))'.
' ORDER BY amavis_users.priority DESC';

(should be in one line)

$sql_select_white_black_list = 'SELECT wb FROM
amavis_wblist,amavis_mailaddr'.
 ' WHERE (amavis_wblist.rid=?) AND 
 (amavis_wblist.sid=amavis_mailaddr.id)'.
 '   AND (amavis_mailaddr.email IN (%k))'.
 ' ORDER BY amavis_mailaddr.priority DESC';

postfix main.cf

now, in postfix main.cf add:

content_filter = smtp-amavis:[127.0.0.1]:10024

postfix master.cf

and in master.cf:

### AMAVIS ANTI-VIRUS/SPAM FILTERING
smtp-amavis     unix    -       -       n       -       4      smtp
 -o smtp_data_done_timeout=1200
 -o smtp_send_xforward_command=yes
 -o disable_dns_lookups=yes
### INCOMING MAIL FROM AMAVIS
127.0.0.1:10025 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=127.0.0.0/8
 -o strict_rfc821_envelopes=yes
 -o smtpd_error_sleep_time=0
 -o smtpd_soft_error_limit=1001
 -o smtpd_hard_error_limit=1000
 -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks