Rspamd 设置本地Fuzzy

  1. 先启用fuzzy,默认是禁用的
# rspamd.conf

worker "fuzzy" {
    bind_socket = "localhost:11335";
    #count = 1; # Disable by default     # 注释这行,启用fuzzy
    .include "$CONFDIR/worker-fuzzy.inc"
    .include(try=true; priority=1,duplicate=merge) "$LOCAL_CONFDIR/local.d/worker-fuzzy.inc"
    .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/worker-fuzzy.inc"
}
  1. 默认是保存到sqlite,改成redis
# worker-fuzzy.inc

backend = "redis";
servers = "127.0.0.1:6379";
password = "myredispass";
db = "1";
  1. 设置本地规则,参考原来rspamd.com规则修改servers、symbol等配置
# modules.d/fuzzy_check.conf

rule "local" {
        algorithm = "mumhash";
        servers = "127.0.0.1:11335";
        symbol = "FUZZY_UNKNOWN_LOCAL";
        mime_types = ["*"];
        max_score = 20.0;
        read_only = yes;
        skip_unknown = yes;
        short_text_direct_hash = true;
        fuzzy_map = {
            FUZZY_DENIED_LOCAL {
                max_score = 20.0;
                flag = 1;
            }
            FUZZY_PROB_LOCAL {
                max_score = 10.0;
                flag = 2;
            }
            FUZZY_WHITE_LOCAL {
                max_score = 2.0;
                flag = 3;
            }
        }    
    }
  1. 重启rspamd查看stat
[root@webmail rspamd]# rspamc stat
Results for command: stat (0.318 seconds)
Messages scanned: 100
Messages with action reject: 59, 59.00%
Messages with action soft reject: 0, 0.00%
Messages with action rewrite subject: 0, 0.00%
Messages with action add header: 0, 0.00%
Messages with action greylist: 2, 2.00%
Messages with action no action: 39, 39.00%
Messages treated as spam: 59, 59.00%
Messages treated as ham: 41, 41.00%
Messages learned: 0
Connections count: 0
Control connections count: 0
Pools allocated: 28
Pools freed: 0
Bytes allocated: 18.74M
Memory chunks allocated: 138
Shared chunks allocated: 17
Chunks freed: 0
Oversized chunks: 1
Fuzzy hashes in storage "local": 0
Fuzzy hashes in storage "rspamd.com": 307127975
Fuzzy hashes stored: 307127975
Statfile: BAYES_SPAM type: redis; length: 0; free blocks: 0; total blocks: 0; free: 0.00%; learned: 0; users: 0; languages: 0
Statfile: BAYES_HAM type: redis; length: 0; free blocks: 0; total blocks: 0; free: 0.00%; learned: 0; users: 0; languages: 0
Total learns: 0

已经正常配置。

转载于:https://my.oschina.net/hxily/blog/2876760

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值