首页 | 邮件资讯 | 技术教程 | 解决方案 | 产品评测 | 邮件人才 | 邮件博客 | 邮件系统论坛 | 软件下载 | 邮件周刊 | 热点专题 | 工具
网络技术 | 操作系统 | 邮件系统 | 客户端 | 电子邮箱 | 反垃圾邮件 | 邮件安全 | 邮件营销 | 移动电邮 | 邮件软件下载 | 电子书下载

反垃圾邮件

技术综述 | 客户端 | 服务器端 |
首页 > 反垃圾邮件 > 服务器端反垃圾邮件技术 > badmailfrom-env patch > 正文

badmailfrom-env patch

出处:转载 作者:转载 时间:2006-6-6 9:36:00
The Patches
badmailfrom-env.patch - Patch for vanilla qmail-1.03.
badmailfrom-env-qregex.patch - Patch for qmail sources that use the qregex features. badmailfrom-env-qregex.patch applies on top of qregex.patch-20020129.
But, Why?
I run two instances of qmail-smtpd, /service/smtpd-a/ and /service/smtpd-b/. I offer virus and spam scanning for my clients, at an additional charge. For the clients who subscribe to this service I set their mx record to a.mx.standblue.net (smtpd-a). Everyone else has their mx record set to b.mx.standblue.net (smtpd-b). The /service/smtpd-a/run file has QMAILQUEUE defined and passes all incoming mail through qmail-scanner. Mail destined for domains with an mx record of b.mx.standblue.net gets passed straight through to the queue, no checking.

Of course, the customers who aren't paying for spam blocking are getting the benefits of what I blacklist in /var/qmail/control/badmailfrom. With the badmailfrom-env patch I added a line to the /service/smtpd-b/run file that specified a different file to use for badmailfrom.

#!/bin/sh

PATH=/var/qmail/bin:$PATH
QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
BADMAILFROM="/var/qmail/control/badmailfrom-b"
export BADMAILFROM
exec /usr/local/bin/softlimit -m 30000000 \
tcpserver -vR -l b.mx.standblue.net -x /service/smtpd-a/tcp.cdb -c "$MAXSMTPD" \
-u "$QMAILDUID" -g "$NOFILESGID" 66.216.97.211 smtp qmail-smtpd 2>&1


Now I can maintain completely separate badmailfrom lists for the two qmail-smtpd services.

Of course, thats just one way the patch can be used. Another would be to specify different badmailfrom files based on where the message is coming from. For example, I have noticed recently that users have been receiving lots of spam from the aol.com networks. Much of the spam has sender addresses from yahoo.com and hotmail, which is obviously not right. You want to still be able to receive mail from users at yahoo.com and hotmail, but not if its being sent from the aol.com network.

The following line can be added to your tcprules file to prevent this from happening:

=.aol.com:allow,BADMAILFROM="/var/qmail/control/badmailfrom-aol"

Then, create a /var/qmail/control/badmailfrom-aol file with the following:

@yahoo.com
@hotmail.com

Don't forget to recompile your tcprules file.

Another way to approach this would be to list @yahoo.com and @hotmail.com in your global badmailfrom file, then have a line in your tcprules file that changed the badmailfrom file to one that doesn't list @yahoo.com or @hotmail.com:

shell$ cat /service/smtpd-a/tcp
=.yahoo.com:allow,BADMAILFROM="/var/qmail/control/badmailfrom-fromyahoo"

Using this method messages with a envelope sender from @yahoo.com can only come from an ip address that reverse resolves to *.yahoo.com . Note that anyone with control of their reverse dns can set an ip to reverse resolve to something under .yahoo.com. Read Russell Nelson's qmail list post about this.

This is not necessarily a recommendation, but rather an example of things that can be done.

Note: If you apply the badmailfrom-env-qregex patch then qmail-smtpd will also look for a BADMAILTO environment variable before it uses control/badmailto.

Applying The Patches
For the vanilla patch, badmailfrom-env, simply copy the file to your qmail-1.03 source directory and run the following command:

shell$ patch < badmailfrom-env.patch

The badmailfrom-env-qregex patch requires that you have already applied the qregex patch to your qmail sources. After that, apply the badmailfrom-env-qregex patch:

shell$ patch < badmailfrom-env-qregex.patch

Finally, stop qmail, make setup check, restart qmail.
相关文章 热门文章
  • 使用badmailfrom控制垃圾邮件
  • Imail反垃圾邮件技术
  • Qmail反垃圾邮件技术
  • 防范垃圾邮件技术
  • 谢绝第三方邮件转发
  • Postfix反垃圾邮件技术
  • Sendmail反垃圾邮件技术
  • 追踪垃圾邮件来源
  • 邮件过滤技术
  • OPEN RELAY的解决方案
  • 美讯智SMG邮件安全网关使用FAQ
  • 三分钟打造反垃圾邮件服务器
  • 黑名单服务器
  • 自由广告区
     
    最新软件下载
  • SharePoint Server 2010 部署文档
  • Exchange 2010 RTM升级至SP1 教程
  • Exchange 2010 OWA下RBAC实现的组功能...
  • Lync Server 2010 Standard Edition 标..
  • Lync Server 2010 Enterprise Edition...
  • Forefront Endpoint Protection 2010 ...
  • Lync Server 2010 Edge 服务器部署文档
  • 《Exchange 2003专家指南》
  • Mastering Hyper-V Deployment
  • Windows Server 2008 R2 Hyper-V
  • Microsoft Lync Server 2010 Unleashed
  • Windows Server 2008 R2 Unleashed
  • 今日邮件技术文章
  • 腾讯,在创新中演绎互联网“进化论”
  • 华科人 张小龙 (中国第二代程序员 QQ...
  • 微软推出新功能 提高Hotmail密码安全性
  • 快压技巧分享:秒传邮件超大附件
  • 不容忽视的邮件营销数据分析过程中的算..
  • 国内手机邮箱的现状与未来发展——访尚..
  • 易观数据:2011Q2中国手机邮箱市场收入..
  • 穿越时空的爱恋 QQ邮箱音视频及贺卡邮件
  • Hotmail新功能:“我的朋友可能被黑了”
  • 入侵邻居网络发骚扰邮件 美国男子被重..
  • 网易邮箱莫子睿:《非你莫属》招聘多过..
  • 中国电信推广189邮箱绿色账单
  • 最新专题
  • 鸟哥的Linux私房菜之Mail服务器
  • Exchange Server 2010技术专题
  • Windows 7 技术专题
  • Sendmail 邮件系统配置
  • 组建Exchange 2003邮件系统
  • Windows Server 2008 专题
  • ORF 反垃圾邮件系统
  • Exchange Server 2007 专题
  • ISA Server 2006 教程专题
  • Windows Vista 技术专题
  • “黑莓”(BlackBerry)专题
  • Apache James 专题
  • 分类导航
    邮件新闻资讯:
    IT业界 | 邮件服务器 | 邮件趣闻 | 移动电邮
    电子邮箱 | 反垃圾邮件|邮件客户端|网络安全
    行业数据 | 邮件人物 | 网站公告 | 行业法规
    网络技术:
    邮件原理 | 网络协议 | 网络管理 | 传输介质
    线路接入 | 路由接口 | 邮件存储 | 华为3Com
    CISCO技术 | 网络与服务器硬件
    操作系统:
    Windows 9X | Linux&Uinx | Windows NT
    Windows Vista | FreeBSD | 其它操作系统
    邮件服务器:
    程序与开发 | Exchange | Qmail | Postfix
    Sendmail | MDaemon | Domino | Foxmail
    KerioMail | JavaMail | Winwebmail |James
    Merak&VisNetic | CMailServer | WinMail
    金笛邮件系统 | 其它 |
    反垃圾邮件:
    综述| 客户端反垃圾邮件|服务器端反垃圾邮件
    邮件客户端软件:
    Outlook | Foxmail | DreamMail| KooMail
    The bat | 雷鸟 | Eudora |Becky! |Pegasus
    IncrediMail |其它
    电子邮箱: 个人邮箱 | 企业邮箱 |Gmail
    移动电子邮件:服务器 | 客户端 | 技术前沿
    邮件网络安全:
    软件漏洞 | 安全知识 | 病毒公告 |防火墙
    攻防技术 | 病毒查杀| ISA | 数字签名
    邮件营销:
    Email营销 | 网络营销 | 营销技巧 |营销案例
    邮件人才:招聘 | 职场 | 培训 | 指南 | 职场
    解决方案:
    邮件系统|反垃圾邮件 |安全 |移动电邮 |招标
    产品评测:
    邮件系统 |反垃圾邮件 |邮箱 |安全 |客户端
    广告联系 | 合作联系 | 关于我们 | 联系我们 | 繁體中文
    版权所有:邮件技术资讯网©2003-2010 www.5dmail.net, All Rights Reserved
    www.5Dmail.net Web Team   粤ICP备05009143号