ExtMail服务器社区's Archiver

liushaobo 发表于 2009-9-25 02:11

Dspam-3.8_Upgrade_3.9

[b]版权声明:[/b]
本文版权归作者所有,如其他个人、第三方网站或媒体报刊等需转载全文或节选,为支持我们的工作,请务必注明如下信息:

文档所有者:Extmail Dev Team;
文章原始出处:[url=http://www.extmail.org/forum/thread-11746-1-1.html]http://www.extmail.org/forum/thread-11746-1-1.html[/url]
项目首页:[url=http://www.extmail.org/]http://wiki.extmail.org[/url]
如果因此而给您带来麻烦,请您原谅,谢谢合作。
感谢 stevan

[b]关于此文[/b]
版  本:0.10
作  者:Liu shaobo <liushaobo (at) extmail (dot) org>
项目主页:[url=http://www.extmail.org/]http://www.extmail.org[/url]
个人主页:[url=http://www.extmail.org/]http://www.extmail.org[/url]
创建日期:2010-8-19

[b]Dspam特点:[/b]
    DSPAM是一个专为企业设计的可扩展并且基于开放源码的垃圾邮件过滤器.在正确配置系统,过滤成功率达99.5 % - 99.95%。 DSPAM支持多种MTA,并还可以部署作为一个独立的SMTP设备。对于软件开发商而言,DSPAM的核心引擎( libdspam )可以很容易地直接引入其过滤器系统,目前,DSPAM已经应用到350000个邮箱中。
    DSPAM能够学习每个用户的不同邮件的习性:根据这些习性告诉过滤器什么是垃圾邮件。这就使得即使在一个很庞大的系统中,DSPAM仍要为每个用户提供高精确度的、智能的过滤功能。并提供了一个能够学习每个用户的邮件习性的管理维护功能,这些习性可能会有些许的误判。DSPAM是很流行的防垃圾工具之一。
    DSPAM的缺点就是依赖用户长时期培训才能取得非常高的垃圾邮件捕获率,不过经过我们的努力,可以减轻甚至克服这个问题。
DSPAM代理可以集成到任何网络,甚至可以作为 SMTP 网关实现。

本文档在EMOS 1.5的基础上,升级Dspam并测试通过。而同类RHEL 4/5 及同系列CentOS 4/5均可基于本文档进行配置使用,具体RPM包下载路径见下文;
Dspam-3.9在Dspam-3.8的基础上,对数据库和内存方面做了很多的优化,WEB界面也更加人性化;
本文档由Extmail项目组负责解释,并根据Extmail项目的建设和发展,适时予以更新;
[b][color=red]备注:[/color][/b]其他配置文件参考EMOS1.5或
[quote]
Dspam+Amavis-new+SA+Clamav for EMOS
文章原始出处:[url=http://www.extmail.org/forum/thread-10393-1-1.html][color=#000000]http://www.extmail.org/forum/thread-10393-1-1.html[/color][/url]
[/quote]


相关软件的下载站点:
[url=http://mirror.extmail.org/yum/rpms/5/i386/]http://mirror.extmail.org/yum/rpms/5/i386/[/url]

相关 rpm 包
dspam-3.9.0-7ext.i386.rpm
dspam-client-3.9.0-7ext.i386.rpm
dspam-devel-3.9.0-7ext.i386.rpm
dspam-hash-3.9.0-7ext.i386.rpm
dspam-libs-3.9.0-7ext.i386.rpm
dspam-mysql-3.9.0-7ext.i386.rpm
dspam-pgsql-3.9.0-7ext.i386.rpm
dspam-sqlite3-3.9.0-7ext.i386.rpm
dspam-web-3.9.0-7ext.i386.rpm
upgrade_3.8_to_3.9


[b][color=red]备注:
[/color][/b]Dspam常见问题解答:(本文档在安装中遇到的问题大部分都有提到)
[url=http://www.extmail.org/forum/thread-10451-1-1.html]http://www.extmail.org/forum/thread-10451-1-1.html[/url]

Dspam使用效果调查:(请使用dspam的朋友能够贴出一个月后的效果)
[url=http://www.extmail.org/forum/thread-10552-1-1.html]http://www.extmail.org/forum/thread-10552-1-1.html[/url]



[b]文档目录[/b]
一、配置 Dspam-3.9
二、升级 Dspam-3.8数据库
三、配置 Dspam-Web 界面


[b]一、配置 Dspam-3.9[/b]

1、卸载 Dspam-3.8 (因为Dspam-3.9的一些目录改变了,所以卸载早期版本后重新安装)
# service dspamd stop
# service dspam-webd stop
# rpm -qa |grep dspam |xargs rpm -e --nodeps
# rm /usr/share/dspam/

2、安装Dspam-3.9
以下为软件的存放目录:/root/rpm ,安装和配置全部以root身份进行
# cd /root/rpm
# rpm -ivh dspam-libs-3.9.0-7ext.i386.rpm
# rpm -ivh dspam-3.9.0-7ext.i386.rpm
# rpm -ivh dspam-client-3.9.0-7ext.i386.rpm
# rpm -ivh dspam-mysql-3.9.0-7ext.i386.rpm
# rpm -ivh dspam-web-3.9.0-7ext.i386.rpm

3、配置 dspam.conf 文件,内容如下:
# vi /etc/dspam/dspam.conf
[quote]Home /var/lib/dspam
StorageDriver /usr/lib/dspam/libmysql_drv.so
TrustedDeliveryAgent "/usr/bin/sendmail"

DeliveryHost 127.0.0.1
DeliveryPort 10024
DeliveryIdent localhost
DeliveryProto SMTP

OnFail error
Trust root
Trust dspam
Trust extmail

TrainingMode teft
TestConditionalTraining on
Feature whitelist
Algorithm graham burton
Tokenizer chain
PValue bcr
WebStats on

Preference "trainingMode=TEFT" # { TOE | TUM | TEFT | NOTRAIN } -> default:teft
Preference "spamAction=quarantine" # { quarantine | tag | deliver } -> default:quarantine
Preference "spamSubject=[SPAM]" # { string } -> default:[SPAM]
Preference "statisticalSedation=5" # { 0 - 10 } -> default:0
Preference "enableBNR=on" # { on | off } -> default:off
Preference "enableWhitelist=on" # { on | off } -> default:on
Preference "signatureLocation=message" # { message | headers } -> default:message
Preference "tagSpam=off" # { on | off }
Preference "tagNonspam=off" # { on | off }
Preference "showFactors=off" # { on | off } -> default:off
Preference "optIn=off" # { on | off }
Preference "optOut=off" # { on | off }
Preference "whitelistThreshold=10" # { Integer } -> default:10
Preference "makeCorpus=off" # { on | off } -> default:off
Preference "storeFragments=off" # { on | off } -> default:off
Preference "localStore=" # { on | off } -> default:username
Preference "processorBias=on" # { on | off } -> default:on
Preference "fallbackDomain=off" # { on | off } -> default:off
Preference "trainPristine=off" # { on | off } -> default:off
Preference "optOutClamAV=off" # { on | off } -> default:off
Preference "ignoreRBLLookups=off" # { on | off } -> default:off
Preference "RBLInoculate=off" # { on | off } -> default:off

AllowOverride enableBNR
AllowOverride enableWhitelist
AllowOverride fallbackDomain
AllowOverride ignoreGroups
AllowOverride ignoreRBLLookups
AllowOverride localStore
AllowOverride makeCorpus
AllowOverride optIn
AllowOverride optOut
AllowOverride optOutClamAV
AllowOverride processorBias
AllowOverride RBLInoculate
AllowOverride showFactors
AllowOverride signatureLocation
AllowOverride spamAction
AllowOverride spamSubject
AllowOverride statisticalSedation
AllowOverride storeFragments
AllowOverride tagNonspam
AllowOverride tagSpam
AllowOverride trainPristine
AllowOverride trainingMode
AllowOverride whitelistThreshold
AllowOverride dailyQuarantineSummary

MySQLServer /var/lib/mysql/mysql.sock
MySQLUser dspam
MySQLPass dspam
MySQLDb dspam
MySQLCompress true
MySQLReconnect true
MySQLConnectionCache 1
MySQLUIDInSignature on

Notifications off
PurgeSignatures 14 # Stale signatures
PurgeNeutral 90 # Tokens with neutralish probabilities
PurgeUnused 90 # Unused tokens
PurgeHapaxes 30 # Tokens with less than 5 hits (hapaxes)
PurgeHits1S 15 # Tokens with only 1 spam hit
PurgeHits1I 15 # Tokens with only 1 innocent hit

LocalMX 127.0.0.1
SystemLog on
UserLog on
Opt out

ServerPort 10028
ServerQueueSize 32
ServerPID /var/run/dspamd.pid
ServerMode auto
ServerPass.Relay1 "secret"
ServerParameters "--user extmail --deliver=innocent,spam -d %u"
ServerIdent "localhost.localdomain"

ClientHost 127.0.0.1
ClientPort 10028
ClientIdent "secret@Relay1"

ProcessorURLContext on
ProcessorBias on
StripRcptDomain off[/quote]

4、启动 Dspam 进程:
# chkconfig dspam on
# service dspam start

查看Dspam启动进程
# ps aux |grep dspam
root     23465  0.2  0.8   7408  2128 pts/0    S    18:15   0:00 /usr/bin/dspam --daemon
root     23468  1.0  0.2   3908   700 pts/1    S+   18:15   0:00 grep dspam



[b]二、升级 Dspam-3.8数据库[/b]

1、备份Dspam-3.8数据库
# mysqldump -u root -p --opt dspam > /root/dspam-3.8.sql

2、升级Dspam-3.8数据库
执行以下脚本升级MySQL的架构到3.9.0模式:
# mysql -u root -p < upgrade_3.8_to_3.9

3、DSPAM的token数据库的定时清理:
# crontab -e
修改以下内容:
[quote]0 0 * * * /usr/bin/mysql -u dspam -p'dspam' dspam < /usr/share/dspam/sql-scripts/mysql/purge-4.1.sql
0 0 * * * /usr/bin/dspam_logrotate -a 30 -d /var/lib/dspam/data[/quote]

4、重启Mysql服务
# service mysqld restart


[b]三、配置DSPAM Web 界面[/b]
[b][color=red]备注:[/color][/b]因为以 EMOS 为基础,里面包含了 perl-GD ,如果没有安装 perl-GD 的, 请自行安装

1、创建dspam-web 认证用户:
# cd /usr/share/dspam/webui/cgi-bin
# echo "extmail" > admins
# htpasswd -c .htpasswd extmail
输入认证密码
[color=red]New password:
Re-type new password:[/color]

2、启动 dspam-web 进程
# service dspam-webd start
这实际是启动了mini_httpd进程,查看 mini_httpd 是否启动正常:
# ps aux |grep mini
dspam    23695  0.0  0.2   5084   764 ?        Ss   18:22   0:00 /usr/bin/mini_httpd -C /etc/dspam/webui.conf
root     23698  0.0  0.2   3908   704 pts/1    S+   18:22   0:00 grep mini

3、重启 apache
# service httpd restart

4、访问 Dspam-web
[url=http://mail.example.com/dspam]http://mail.example.com/dspam[/url]
输入你在 .htpasswd 文件中创建的用户和密码

疯狂老头 发表于 2009-9-25 07:18

上面的中文字体更漂亮了哦。楼主不是自己修改了吧?

liushaobo 发表于 2009-9-25 09:01

没有改,dspam-web自带的

dnnljexk 发表于 2009-9-25 09:02

帮顶~~~~~~~~

lixvfei 发表于 2009-9-25 09:14

顶!!!为什么我的dspam看邮件标题不少都是乱码呢??

jgh2008 发表于 2009-9-25 09:27

顶顶顶。。。。

chinahrb 发表于 2009-9-25 12:43

把网页代码改成UTF-8就不乱码了(查看-编码-UTF-8)

edit 发表于 2009-9-27 16:51

升级DSPAM3.9的话,除了数据库要升级,程序应当也要升级吧!

mouse 发表于 2009-9-28 09:17

还是等发布dspam 3.9的rpm包吧, 偷懒中..

chinahrb 发表于 2009-9-28 09:29

我与EDIT兄有同样的疑惑,请liushaobo大侠说详细点好吗?谢谢

liushaobo 发表于 2009-9-28 10:38

我用的dspam-rpm包和ext发布的rpm包有点不一样,安装后要改点配置,只是把主要的sql升级文件放出来了

fzhyextmail 发表于 2009-10-16 10:15

继续跟踪。没觉得中文字体有多大变化,发现history中多了个判别邮件筛选,不错

mouse 发表于 2009-10-20 21:36

不知道现在有rpm下载了吗?

yhzhou 发表于 2009-10-21 10:05

顶一个~

edit 发表于 2009-11-26 12:41

目前dspam-3.9的rpm好像都是altlinux和fc下的,用源码有点烦

liushaobo 发表于 2009-11-26 13:37

我最近几天把原来的dspam-3.9的rpm包再简化一下,然后放出给大家测试看看

mouse 发表于 2009-11-26 20:19

哦。太好了!!

liushaobo 发表于 2009-12-21 00:50

dspam-3.9的rpm基本制作好了,再请强哥加工一下,就可以发布了:lol

minechina 发表于 2009-12-21 10:08

等待发布。顶一下。

jojo 发表于 2009-12-21 10:09

又一个等待的:lol

liushaobo 发表于 2009-12-27 12:18

:L  我晕哦,没去dspam官方看,原来Released已经出来了,又要改rpm了:L

chifeng 发表于 2009-12-28 14:25

跟顶。。。。

liushaobo 发表于 2009-12-28 20:04

哎...dspam-3.9.RC的webui让我很郁闷:L

lpstt 发表于 2010-1-5 14:01

中文邮件标题还是乱码!求解中

liushaobo 发表于 2010-1-5 15:02

用dspam-3.9.alpha版本或dspam-3.9 GIT版本

lpstt 发表于 2010-1-5 17:48

alpha、 GIT版本和R版本有什么区别

liushaobo 发表于 2010-1-5 18:23

[quote]原帖由 [i]lpstt[/i] 于 2010-1-5 17:48 发表 [url=http://www.extmail.org/forum/redirect.php?goto=findpost&pid=71918&ptid=11746][img]http://www.extmail.org/forum/images/common/back.gif[/img][/url]
alpha、 GIT版本和R版本有什么区别 [/quote]

[url]http://www.extmail.org/forum/viewthread.php?tid=13026&extra=page%3D1&frombbs=1[/url]
功能上的区别你可以看官方的changelog

lingping 发表于 2010-3-28 20:28

3.9 RPM包有发布了吗?

页: [1] 2

Powered by Discuz! Archiver 7.0.0  © 2001-2009 Comsenz Inc.