Archive

Posts Tagged ‘clamav’

Установка и настройка ClamSMTP для Postfix

April 15th, 2009 No comments

Установка:

1
2
3
4
5
6
7
$ cd /usr/ports/security/clamsmtp
$ make showconfig
===> The following configuration options are available for clamsmtp-1.10_1:
     LOCAL_CLAMAV=on "RUN_DEPEND on security/clamav"
     LOCAL_CLAMAV_DEVEL=off "RUN_DEPEND on security/clamav-devel"
===> Use 'make config' to modify these settings
$ make install clean

Прописываем в rc.conf:

1
clamsmtpd_enable="YES"

Копируем конфиг:

1
2
$ cd /usr/local/etc/
$ cp clamsmtpd.conf-sample clamsmtpd.conf

Настраиваем:

1
2
3
4
OutAddress: 127.0.0.1:1026
Listen: 127.0.0.1:1025
ClamAddress: /var/run/clamav/clamd.sock
User: clamav

Запускаем:

1
$ /usr/local/etc/rc.d/clamsmtpd start

Настраиваем master.cf в Postfix’e (в моем случае подключена еще и спамоборона):

1
2
3
4
5
6
7
smtp      inet  n       -       n       -       -       smtpd
    -o content_filter=so-filter
127.0.0.1:1026  inet  n       -       n       -       -       smtpd
    -o content-filter=
so-filter     unix  -       n       n       -       -       pipe
    flags=q. user=souser argv=/usr/local/sbin/sp-postfix
    -a ${client_address} -f ${sender} -- ${recipient}

Путь письма при этом выглядит так:

1
mail -> smtpd (25) -> sofilter -> clamav (1025) -> smtpd (1026) -> mail

Перезапускаем Postfix:

1
$ postfix reload

Установка и работа с ClamAV

April 15th, 2009 No comments

Установка:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ cd /usr/ports/security/clamav
$ make showconfig
make install ===> The following configuration options are available for clamav-0.95.1:
     ARC=on "Enable arch archives support"
     ARJ=on "Enable arj archives support"
     LHA=on "Enable lha archives support"
     UNZOO=on "Enable zoo archives support"
     UNRAR=on "Enable rar archives support"
     MILTER=off "Compile the milter interface"
     LDAP=off "libmilter was built with LDAP"
     ICONV=off "Enable ICONV support"
     STDERR=off "Print logs to stderr instead of stdout"
     EXPERIMENTAL=off "Build experimental code"
===> Use 'make config' to modify these settings
$ make install clean

Обновление антивирусных баз выполняется командой

$ freshclam

Или демоном, контролируемым сценарием:

/usr/local/etc/rc.d/clamav-freshclam

Проверка файлов производится самостоятельной командой

$ clamscan

или командой

$ clamdscan

работающей совсместно с демоном clamd, который контролируется сценарием

/usr/local/etc/rc.d/clamav-clamd
Tags: