博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
qmail+spamassassin启用spf过滤
阅读量:5968 次
发布时间:2019-06-19

本文共 3348 字,大约阅读时间需要 11 分钟。

  hot3.png

先检测是否支持spf模块

[root@localhost ~]# sa-update -D[13454] dbg: logger: adding facilities: all[13454] dbg: logger: logging level is DBG[13454] dbg: generic: SpamAssassin version 3.2.0[13454] dbg: config: score set 0 chosen.[13454] dbg: dns: no ipv6[13454] dbg: dns: is Net::DNS::Resolver available? yes[13454] dbg: dns: Net::DNS version: 0.59[13454] dbg: generic: sa-update version svn523403[13454] dbg: generic: using update directory: /var/lib/spamassassin/3.002000[13454] dbg: diag: perl platform: 5.008008 linux[13454] dbg: diag: module installed: Digest::SHA1, version 2.11[13454] dbg: diag: module installed: HTML::Parser, version 3.55[13454] dbg: diag: module installed: Net::DNS, version 0.59[13454] dbg: diag: module installed: MIME::Base64, version 3.07[13454] dbg: diag: module installed: DB_File, version 1.814[13454] dbg: diag: module installed: Net::SMTP, version 2.29[13454] dbg: diag: module not installed: Mail::SPF ('require' failed)[13454] dbg: diag: module not installed: Mail::SPF::Query ('require' failed)[13454] dbg: diag: module not installed: IP::Country::Fast ('require' failed)[13454] dbg: diag: module not installed: Razor2::Client::Agent ('require' failed)[13454] dbg: diag: module not installed: Net::Ident ('require' failed)

这提示odule not installed: Mail::SPF ('require' failed),表示没安装spf模块,先安装

[root@localhost ~]# yum install epel-release -y[root@localhost ~]# yum install perl-Mail-SPF perl-Mail-SPF-Query -y[root@localhost ~]# sa-update -D[19738] dbg: logger: adding facilities: all[19738] dbg: logger: logging level is DBG[19738] dbg: generic: SpamAssassin version 3.2.0[19738] dbg: config: score set 0 chosen.[19738] dbg: dns: no ipv6[19738] dbg: dns: is Net::DNS::Resolver available? yes[19738] dbg: dns: Net::DNS version: 0.59[19738] dbg: generic: sa-update version svn523403[19738] dbg: generic: using update directory: /var/lib/spamassassin/3.002000[19738] dbg: diag: perl platform: 5.008008 linux[19738] dbg: diag: module installed: Digest::SHA1, version 2.11[19738] dbg: diag: module installed: HTML::Parser, version 3.55[19738] dbg: diag: module installed: Net::DNS, version 0.59[19738] dbg: diag: module installed: MIME::Base64, version 3.07[19738] dbg: diag: module installed: DB_File, version 1.814[19738] dbg: diag: module installed: Net::SMTP, version 2.29[19738] dbg: diag: module installed: Mail::SPF, version v2.007[19738] dbg: diag: module installed: Mail::SPF::Query, version 1.999001

现在查看已经安装了,下面添加spf评分并测试

trusted_networks 127.0.0.1   #信任的IP地址envelope_sender_header Fromscore SPF_PASS -1score SPF_FAIL 200score SPF_SOFTFAIL 200
[root@localhost ~]# spamassassin -D 

测试已经生效,重启spamassassin即可

注意,如果测试spf检测未通过,提示

[5033] dbg: spf: query for /118.244.232.82/localhost.localdomain: result: none, comment: , text: No applicable sender policy available[5033] dbg: spf: already checked for Received-SPF headers, proceeding with DNS based checks[5033] dbg: spf: cannot get Envelope-From, cannot use SPF[5033] dbg: spf: def_spf_whitelist_from: already checked spf and didn't get pass, skipping whitelist check[5033] dbg: spf: whitelist_from_spf: already checked spf and didn't get pass, skipping whitelist check

这个错误就要检查 envelope_sender_header From 这行参数是否正确 信头的白名单检查按照如下顺序:如果信头设置了 Resent-From 地址,那么就检查它;否则检查来自下列信头的全部地址: Envelope-Sender Resent-Sender X-Envelope-From From

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

你可能感兴趣的文章
MaxCompute,基于Serverless的高可用大数据服务
查看>>
实现一个EventTarget类
查看>>
es6 find 数组内查询用法
查看>>
高清的GIF表情包如何制作
查看>>
研发团队资源成本优化实践
查看>>
【译】 WebSocket 协议第十一章——IANA 注意事项(IANA Considerations)
查看>>
Celery中文翻译-Application
查看>>
关于微信 setData 回调函数中的坑
查看>>
151. Reverse Words in a String
查看>>
区块链组织-超级账本(Hyperledger)的简介
查看>>
附实例!图解React的生命周期及执行顺序
查看>>
《从0到1学习Flink》—— Flink 读取 Kafka 数据批量写入到 MySQL
查看>>
css实现图片自适应容器的几种方式
查看>>
https的那些事儿
查看>>
CentOS7.5常用命令整理
查看>>
hostingranking.cn·基于ghost的轻量技术架构整理
查看>>
DOM的那些事
查看>>
02go 基础知识
查看>>
vscode插件列表及配置信息
查看>>
238. Product of Array Except Self
查看>>