服务器搭建手册之FREEBSDUNIX邮件服务器建设(十一)

六、防病毒与防垃圾邮件功能建立.

1、安装Clamav

#cd /usr/ports/security/clamav

 

# make install clean

正确选择:

要想clamav能自动的启动,要在/etc/rc.conf中加入:

clamav_clamd_enable=”YES”

clamav_freshclam_enable=”YES”

重启服务器.

2、测试杀毒

# clamscan -r -i /usr/local/www/data

———– SCAN SUMMARY ———–
Known viruses: 40460
Engine version: 0.87
Scanned directories: 63
Scanned files: 1166
Infected files: 0
Data scanned: 13.06 MB
Time: 63.233 sec (1 m 3 s)

3、升级病毒库

# freshclam

ClamAV update process started at Sun Oct 16 14:32:00 2005
main.cvd is up to date (version: 34, sigs: 39625, f-level: 5, builder: tkojm)
Downloading daily.cvd [*]
daily.cvd updated (version: 1136, sigs: 948, f-level: 6, builder: ccordes)
Database updated (40573 signatures) from database.clamav.net (IP: 140.128.9.18) Clamd successfully notified about the update.

4、安装MailScanner

# cd /usr/ports/mail/mailscanner

# make install

第一次执行安装因此需执行make initial-config以建立基本配置文件

# make initial-config

# make clean

服务器搭建手册之FREEBSDUNIX邮件服务器建设(十四)

增加黑白名单:

1、IP黑名单:

 

ip_black_list.txt

 

2、IP白名单

 

ip_white_list.txt

 

3、域名黑名单

 

dn_black_list.txt

 

4、域名白名单

 

dn_white_list.txt

七、查看系统状态

安装phpSysInfo

# cd /usr/ports/www/phpSysInfo

 

#make install clean

 

# cd /usr/local/www/phpSysInfo

 

# cp config.php.new config.php

#cd ..

# cp –rf phpSysInfo /usr/local/www/apache22/data/

查看结果:http://ip/phpSysInfo

如图:

关于webmail里无法增加新域和增加新用户的修正备忘录

  • mkdri /tmp/postfix/
  • 修改/usr/local/www/apache22/data/webmail/config/config_inc.php

#vi /usr/local/www/apache22/data/webmail/config/config_inc.php

将$CFG_BASEPATH = “/tmp/igenus/temp”;改成

$CFG_BASEPATH = “/tmp/postfix/temp “;

  • 修改/usr/local/www/apache22/data/webmail/webadmin/include/config.inc.php

将define(DOMAINSDIR,”/mail/ftp/mail”);

改成:define(DOMAINSDIR,”/var/mail”);

  • 修改postfix数据库的userinfo表格结构,加入postmaster字段。

`postmaster` tinyint(1) default NULL,

ALTER TABLE `userinfo` ADD `postmaster` TINYINT( 1 ) NULL ;

  • 重启mysql数据库.

#/usr/local/share/mysql/mysql.server restart

 

六,赋于权限。

#mkdir /tmp/postfix/

#chown -R postfix:postfix /tmp/postfix

#chmod -R 777  /tmp/postfix

 

七,对于用户登陆后,网络硬盘netdisk不能用的解决办法

#mkdir /var/mail/netdisk/

#chown –R postfix:postfix /var/mail/netdisk/

#chown –R 777 /var/mail/netdisk/