【邮件服务器配置教程系列四】 为 Spamassassin 添加 DCC 检查

在之前三个系列的基础上,本文我们将加强 反垃圾 (AS) 功能,添加 DCC 配置

原文 https://wiki.apache.org/spamassassin/InstallingDCC 已经比较清楚的描述了下载,编译,配置的过程。

wget http://www.dcc-servers.net/dcc/source/dcc-dccproc.tar.Z
tar xfvz dcc-dccproc.tar.Z
cd dcc-dccproc-*
./configure && make && make install

编译成功后,运行 # /usr/local/bin/cdcc info 应该可以看到如下的信息:

# 02/23/18 13:57:20 CST /var/dcc/map
# Re-resolve names after 15:22:51 Check RTTs after 14:10:30
# 1454.81 ms threshold, 1330.41 ms average 12 total, 10 working servers
IPv6 on version=3

dcc1.dcc-servers.net,- RTT+1000 ms anon

  编辑 /etc/mail/spamassassin/v310.pre ,反注释掉
loadplugin Mail::SpamAssassin::Plugin::DCC

编辑 /etc/mail/spamassassin/local.cf
添加 dcc_path /usr/local/bin/dccproc

重启 spamassassin 服务,在 maillog 日志里,可以看到 DCC_CHECK 的关键字了。

spamd[15152]: spamd: result: Y 19 – DCC_CHECK,FREEMAIL_FROM,FSL_BULK_SIG,FSL_HELO_FAKE,MISSING_MID,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_PBL,RCVD_IN_PSBL,RCVD_IN_SORBS_DUL,RCVD_IN_SORBS_WEB,RCVD_IN_XBL,RDNS_DYNAMIC,SPF_HELO_SOFTFAIL,SPF_SOFTFAIL,TO_NO_BRKTS_DYNIP scantime=18.0,size=810,user=postfix,uid=89,required_score=6.5,rhost=localhost,raddr=127.0.0.1,rport=/run/spamassassin/spamd.sock,mid=(unknown),autolearn=no autolearn_force=no

检查: # spamassassin -D dcc < /usr/share/doc/spamassassin-*/sample-spam.txt
Feb 23 19:57:24.260 [2669] dbg: dcc: network tests on, registering DCC
Feb 23 19:57:25.156 [2669] dbg: dcc: dcc_pgm_path, found cdcc in dcc_path: /usr/local/bin/cdcc
Feb 23 19:57:25.180 [2669] dbg: dcc: `/usr/local/bin/cdcc -qV homedir libexecdir` reports ‘1.3.162 homedir=/var/dcc libexecdir=/var/dcc/libexec ‘
Feb 23 19:57:25.180 [2669] dbg: dcc: use ‘dcc_libexec /var/dcc/libexec’ from cdcc
Feb 23 19:57:25.180 [2669] dbg: dcc: use ‘dcc_home /var/dcc’ from cdcc
Feb 23 19:57:25.180 [2669] dbg: dcc: dccifd is not available; no r/w socket at /var/dcc/dccifd
Feb 23 19:57:25.180 [2669] dbg: dcc: /usr/local/bin/dccproc is available
Feb 23 19:57:25.181 [2669] dbg: dcc: opening pipe to /usr/local/bin/dccproc -C -x 0 -R -w whiteclnt </tmp/.spamassassin2669rYtJ8Ntmp
Feb 23 19:57:25.486 [2669] dbg: dcc: dccproc responded with ‘X-DCC-x.dcc-servers-Metrics: mailhostname 104; Body=many Fuz1=many Fuz2=many’
Feb 23 19:57:25.486 [2669] dbg: dcc: listed: BODY=999999/999999 FUZ1=999999/999999 FUZ2=999999/999999 REP=0/90
Feb 23 19:57:26.499 [2669] dbg: dcc: DCC learning not enabled by dcc_learn_score

作者: 甬洁网络

--移动互联网&物联网技术提供商