#创建freshclam日志记录文件
mkdir -p /var/log/clamav
touch /var/log/clamav/clamd.log
chown clamav.clamav -R /var/log/clamav/
chmod 644 -R /var/log/clamav/
#创建clamav启动脚本
vi /etc/rc.d/init.d/clamav
--------------------------------------------------------------------------------------------
#!/bin/sh
#
# Startup / shutdown script for Clam Antivirus
case "$1" in
start)
/usr/local/sbin/clamd && echo -n 'Clamd started'
/usr/local/bin/freshclam -d -c 2 -l /var/log/freshclam.log
echo -n ' freshclam started'
;;
stop)
/usr/bin/killall clamd >; /dev/null 2>;&1 && echo -n 'Clamd stoped'
/usr/bin/killall freshclam >; /dev/null 2>;&1 && echo -n ' freshclam Stoped'
;;
*)
echo ""
echo "Usage: `basename $0` { start | stop }"
echo ""
exit 64
;;
esac
-------------------------------------------------------------------------------------------------
#使其能够执行
chmod 755 /etc/init.d/clamav
#随开机起动
ln -s /etc/init.d/clamav /etc/rc.d/rc3.d/S88clamav
ln -s /etc/init.d/clamav /etc/rc.d/rc5.d/S88clamav
安装MailDrop 和TNEF reader:
TNEF是一个从"application/ms-tnef". 类型中找出MIME附件的程序.这仅仅是微软系统中的一种附件.TNEF程序允许将封装成TNEF的附件提取出来. 安装TNEF并不是必须的, 但我强烈推荐安装它!
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.2.tar.gz
tar -zxf pcre-7.2.tar.gz
cd pcre-7.2
./configure
make
make install
cd /opt/src/tar
wget
cd ..
tar -xjf tar/maildrop-2.0.4.tar.bz2
cd maildrop-2.0.4
./configure
make
make install-strip
make install-man
wget
tar -xzvf tar/tnef-1.4.3.tar.gz
cd tnef-1.4.3
./configure
make
make install
#使用Maildrop调用SpamAssassin
#在/home/vpopmail/domains/localhost.com(你创建的域)/ 建立mailfilter文件
touch mailfilter
chown vpopmail:vchkpw mailfilter
chmod 700 mailfilter
vi mailfilter
#mailfilter内容如下:
---------------------------------------------------------------------------
VHOME=`/mail/vpopmail/bin/vuserinfo -d $EXT@$HOST`
VSPAM=`/mail/vpopmail/bin/vuserinfo -d $EXT@$HOST`
`test -d $VHOME/Maildir/`
if( $RETURNCODE != 0 )
{
echo "Sorry , but the user $EXT@$HOST dos not exist"
EXITCODE=77
exit
}
if ( $SIZE < 262144 )
{
exception {
xfilter "/usr/bin/spamc -f -u $EXT@$HOST"
}
}
if (/^X-Spam-Flag: YES/)
{
to "$VSPAM/Maildir/.Trash/."
EXITCODE=0
}
else
{
to "$VHOME/Maildir/."
}
--------------------------------------------------------------------------------
#修改.qmail-default内容如下:
vi .qmail-default
| preline /usr/local/bin/maildrop mailfilter
安装Qmailscanner:
cd /opt/src/tar
wget
groupadd qscand
useradd qscand -c "Qmailscanner" -g qscand -s /bin/false
./configure --admin postmaster --domain szgwbn.net.cn --scanners "clamscan" --notify sender,admin --lang en_GB --archive yes --unzip yes
./configure --admin postmaster --domain szgwbn.net.cn --scanners "clamscan" --notify sender,admin --lang en_GB --archive yes --unzip yes --install
chmod 4711 /usr/bin/suidperl
chmod 6755 /mail/vpopmail/bin/vchkpw
chmod 0755 /var/qmail/bin/qmail-scanner-queue.pl
用普通用户登录测试:
/var/qmail/bin/qmail-scanner-queue.pl -g
记得将/var/spool/qscan设为777 否则出错
安装iGenus(可选):
cd /opt/src
tar zxvf igenus_2.0.2_20040901_release.tgz -C /mail/apache2/htdocs/
cd /mail/apache2/htdocs/
mv igenus/* ./
#建temp文件夹
mkdir /tmp/temp
chmod -R 0755 /tmp/temp
chown -R vpopmail:vchkpw /tmp/temp
mkdir /mail/netdisk
chmod -R 0755 /mail/netdisk
chown -R vpopmail:vchkpw /mail/netdisk
chmod -R 0755 /mail/apache2/htdocs/
chown -R vpopmail:vchkpw /mail/apache2/htdocs/
#修改httpd.conf
vi /etc/httpd/conf/httpd.conf
User vpopmail
Group vchkpw
AddDefaultCharset GB2312 //使默认页面为中文
/etc/rc.d/init.d/httpd restart //重启apache,使修改生效
#修改config_inc.php文件
cd //config
vi config_inc.php
$CFG_BASEPATH = "/var/www/html/"; \\改成你安装的目录
$CFG_MYSQL_HOST = 'localhost';
$CFG_MYSQL_USER = 'vpopmail'; \\vpopmail访问mysql的帐号
$CFG_MYSQL_PASS = 'xukixu'; \\vpopmail访问mysql的密码
$CFG_MYSQL_DB = 'vpopmail'; \\数据库
$CFG_TEMP = "/tmp/temp"; \\删除$CFG_BASEPATH,并修改路径