[安装环境]
操作系统:CentOS 5.6
MAT:POSTFIX2.8.4
安装之前必须保证POSTFIX能正常收发信
如果已经安装过Berkeley Db3以上版本可以不安装新的DB(但是注意引入db.so)
[安装步骤]
1、milter-limit-0.14.tar.gz及libsnert-1.71.6.tar.gz包的获取方法
需要创建一个用户名才可以下载免费的资源
free资源列表的下方有个creat account的按钮点击进去注册一个账号然后登陆就可以下载咯!
软件版本: milter-limit-0.14.tar.gz libsnert-1.73.17.tar.gz milter-clamc-0.6.tar.gz
约定:以上三个包都放在/usr/local/chenfei/目录下
2、下载地址
milter-limit-0.14.tar.gz
http://www.snertsoft.com/clients/downloads.php
libsnert-1.71.6.tar.gz
http://www.snertsoft.com/clients/downloads.php
sendmail.8.14.2.tar.gz
ftp://ftp.sendmail.org/pub/sendmail/sendmail.8.14.2.tar.gz
db-4.5.20.tar.gz
http://download.Oracle.com/berkeley-db/db-4.5.20.tar.gz
3、开始安装
[安装Berkeley Db4.5]
#tar -zvxf db-4.5.20.tar.gz
#cd db-4.5.20/build_unix
#../dist/configure --prefix=/usr/local
#make
#make install
[安装sendmail libmilter]
#tar sendmail.8.14.2.tar.gz
#cd sendmail-8.14.2/libmilter
#sh Build -c
#sh Build install
[安装libsnert 和 milter-limit]
#tar -zvxf libsnert-1.73.17.tar.gz
#tar -zvxf milter-limit-0.14.tar.gz
#cd com/snert/src/lib
#./configure
#make build
#cd ../milter-limit
#./configure
#make build
#make install
至此,所有软件安装完毕。
[配置生效]
确保上述软件都安装正确,接着就让postfix调用milter-limit来控制收发信数量了。
#vi /etc/postfix/main.cf
至配置文件最后另起一行加入:
smtpd_milters = unix:/var/run/milter/milter-limit.socket
#cd /etc/mail
#touch access
#vi access
编辑一个控制
milter-limit-From:tcimi.com 1/m
#makemap hash /etc/mail/access.db < /etc/mail/access
生成db库
启动milter-limit和postfxi
#/usr/local/sbin/milter-limit run-user=postfix run-group=postfix access-db=/etc/mail/access.db verbose=all policy=reject -restart
#postfix stop
#postfix start
#tail -f /var/log/maillog 监控下maillog看是否报错
Dec 30 12:05:48 mon-gdzj-cu-168-185 milter-limit[17777]: milter-limit/0.14.86 Copyright 2004, 2007 by Anthony Howe. All rights reserved.
Dec 30 12:05:48 mon-gdzj-cu-168-185 milter-limit[17777]: LibSnert/1.73.17 Copyright 1996, 2010 by Anthony Howe. All rights reserved.
Dec 30 12:05:48 mon-gdzj-cu-168-185 milter-limit[17777]: libmilter version 1.0.0
Dec 30 12:05:48 mon-gdzj-cu-168-185 milter-limit[17777]: Berkeley DB 4.5.20: (September 20, 2006)
说明正常