2007/08/17

How to Install and configure Clamav-milter on Fedora 7

If install clamav-milter by yum,
will install the following rpm packages:

fedora-usermgmt-default-fedora-setup.noarch
fedora-usermgmt-core.noarch
fedora-usermgmt-shadow-utils.noarch
fedora-usermgmt.noarch
clamav-filesystem.i386
clamav-data.i386
clamav-lib.i386
clamav-milter.i386
clamav-milter-sysv.i386
clamav-update.i386

but the installed clamav version is 0.90.3-1.fc7 out of date.

I want to install new 0.91.1 version clamav-milter by rpm,
and finding here:
http://download.fedora.redhat.com/pub/fedora/linux/updates/testing/7/i386/
with some new version 0.91.1 clamav-milter.
and some release or bug information here:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=248482

the following is installing steps:
1.
remove the mentioned rpm packages.

2.
yum install fedora-usermgmt, because this package is nessary to install clamav-milter.

3.
get these rpm files:
clamav-lib-0.91.1-1.fc7.i386.rpm
clamav-data-0.91.1-1.fc7.i386.rpm
clamav-filesystem-0.91.1-1.fc7.i386.rpm
clamav-milter-0.91.1-1.fc7.i386.rpm
clamav-milter-sysv-0.91.1-1.fc7.i386.rpm
clamav-update-0.91.1-1.fc7.i386.rpm
from:
http://download.fedora.redhat.com/pub/fedora/linux/updates/testing/7/i386/

4.
import rpm gpg key:
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-test

5.
rpm install up mentioned packages.

6.
edit /etc/freshclam.conf
change following lines to:
#Example
DatabaseDirectory /var/lib/clamav
PidFile /var/run/freshclam.pid
DatabaseOwner clamav

7.
edit /etc/clamd.d/milter.conf
change following lines to:
#Example
LogTime yes
LogSyslog yes
PidFile /var/run/clamav-milter/clamd.pid
TemporaryDirectory /tmp
DatabaseDirectory /var/lib/clamav
#LocalSocket /var/run/clamav.milter/clamd.sock

8.
edit /etc/sysconfig/clamav-milter
====================================
CLAMAV_FLAGS=" --config-file=/etc/clamd.d/milter.conf \
--quiet \
--dont-wait \
--noreject \
--force-scan \
--local \
--outgoing \
local:/var/run/clamav-milter/clamav.sock \
"
=======================================
NOTICE:
some directories in these config file are not consistent,
if something wrong when executing,
check these directory name!

9.
edit /etc/sysconfig/freshclam
to make new virus pattern update enable.
add mark this line:
#FRESHCLAM_DELAY=disabled-warn # REMOVE ME

10.
configure the sendmail.cf
go to /usr/share/sendmail-cf/cf
if no these directory
yum install sendmail-cf

edit sendmail.mc
==========================
divert(-1)
#
# Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
# All rights reserved.
# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
# The Regents of the University of California. All rights reserved.
#
# By using this file, you agree to the terms and conditions set
# forth in the LICENSE file which can be found at the top level of
# the sendmail distribution.
#
#

#
# This is a generic configuration file for Linux.
# It has support for local and SMTP mail only. If you want to
# customize it, copy it to a name appropriate for your environment
# and do the modifications there.
#

divert(0)dnl
VERSIONID(`$Id: generic-linux.mc,v 8.1 1999/09/24 22:48:05 gshapiro Exp $')
OSTYPE(linux)dnl
DOMAIN(generic)dnl
undefine(`UUCP_RELAY')dnl
undefine(`BITNET_RELAY')dnl
MASQUERADE_AS(XXX.xxx.com)dnl
define(`confBAD_RCPT_THROTTLE', `3')dnl
define(`confTO_IDENT',`0s')dnl
define(`confMILTER_LOG_LEVEL',`1')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
FEATURE(local_procmail)dnl
INPUT_MAIL_FILTER(`clamav', `S=local:/var/run/clamav-milter/clamav.sock, F=, T=S:4m;R:4m')dnl
define(`confINPUT_MAIL_FILTERS', `clamav')dnl
define(`SMART_HOST',`XXXhost')dnl
define(`STATUS_FILE',`/etc/mail/statistics')dnl
FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable')dnl
FEATURE(`access_db', `hash -T -o /etc/mail/access')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable')dnl
FEATURE(`blacklist_recipients')dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
=========================
Notice:
make sure the socket string is same as /etc/sysconfig/clamav-milter

./Build sendmail.cf
cp sendmail.cf /etc/mail/sendmail.cf

11.
cd /etc/init.d/
chkconfig clamav-milter on
./clamav-milter start
./sendmail start

Labels: , , , , , ,