用postfwd取代extmail 的slockd

软件集成
431
linux
linux 举报
2022-08-17
用postfwd取代extmail 的slockd

用过sockd 的人都知道,slockd 并不是十分理想,白名单只能靠本地的,所以常常导至邮件不能正常接收,网上有很多postfix policy server,目前发现只有postfwd 十分强大,于是产生了用postfwd取代slockd 的想法,事实证明,postfwd 配置十分灵活,效果很理想,但是少了一个灰名单功能。

<pre># local white list //本地白名单,含机器名,IP,发件人 id=WL_001 ;action=OK ;client_name=file:/etc/postfwd/client_name_whitelist id=WL_002 ;action=OK ;client_address=file:/etc/postfwd/client_address_whitelist id=WL_003 ;action=OK ;sender=file:/etc/postfwd/sender_whitelist # local back list //本地黑名单 id=BL_001 ;action=REJECT list on local client_name_backlist;client_name=file:/etc/postfwd/client_name_backlist id=BL_002 ;action=REJECT list on local client_address_backlist;client_address=file:/etc/postfwd/client_address_backlist id=BL_003 ;action=REJECT list on local sender_backlist ;sender=file:/etc/postfwd/sender_backlist # limit rate //未知发件地址,限制发邮件数量 id=RATE_001; client_name==unknown; action=rate(client_address/5/300/450 4.7.1 only 5 recipients per 5 minutes allowed) # Check HELO and reverse DNS //对EHLO 和DNS 过滤,有效过虑大部分ADSL 地址 id=SET_HELO;helo_name=^(\[|[^.]+$|.*?[0-9.-]{8});action=set(HIT_helo=1) id=SET_NODNS;client_name=^unknown$;action=set(HIT_nodns=1) id=REJECT_HELO_NODNS;HIT_helo==1; HIT_nodns==1;action=REJECT Blocked - Suspicious HELO [$$helo_name] and missing reverse DNS [$$client_address] # dns white list //使用下面两个DNS 白名单,国内外大部分邮件运营商都可以快速通过 id=DNSWL_01; rbl=list.dnswl.org/^127/43200; action=OK id=DNSWL_02; rbl=cml.anti-spam.org.cn/^127/43200; action=OK # DNS RBL //国内的RBL 具体看 www.anti-spam.org.cn id=RBL_001;rbl=cblplus.anti-spam.org.cn;action=REJECT Blocked on cblplus.anti-spam.org.cn # 外国DNS黑名单,只要匹配两个地址以上,就拒绝,其实匹配一个想弄成灰名单的,,后来没有搞。 &&DNSBLS{ rbl=zen.spamhaus.org rbl=bl.spamcop.net rbl=dnsbl.sorbs.net } id=RBL_002;&&DNSBLS;rblcount=all;action=set(HIT_rbls=$$rblcount,HIT_dtxt=$$dnsbltext) id=RBL_003;HIT_rbls>=2;action=REJECT Blocked on Multiple DNSBLs [$$HIT_dtxt]

启动方法

1./postfwd-1.35 -f postfwd.cf -u vuser -g vgroup -d

postfwd-- 使用perl写的一个postfix的Policy server


似乎功能也蛮强大的,不知道性能如何:


可以根据发送方的多个条件:


发送方ip,helo name,反向解析,发送人地址,时间段,时间点,是否被rbl等等


作出相应的动作:


拒绝,接受,发送频率限制,发送邮件总累计大小限制 等等




而且还支持打分(scoring)机制






http://postfwd.org/


倒序看帖 只看楼主
热点关注
/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
服务停止、启动、重启一体化脚本,万能语言启动脚本
shell参数判断
在后台用进程名运行bash脚本
shell脚本每行后面多了一个^M的原因和解决办法
定时检测服务,检测down掉后重启。系统检测到DMSERVER运行正常
挂载磁盘的时候遇到一个问题,挂载完磁盘之后重启服务器挂载的盘丢失了.
中标麒麟系统Your trial is EXPIRED and no VALID licens
termux 开启ssh并用用户名和密码登陆
组成共享库的目标文件和一般的目标文件有所不同,在编译时要加-fPIC和-share选项,例如:
gcc指定链接库路径后还是找不到库文件
./configure -build,-host,-target设置
shell脚本每行后面多了一个^M的原因和解决办法
shell 中 if [ “x${var}“ == “x“ ] 中 x的作用
查看linux机器是32位还是64位的方法