Chinaunix首页 | 论坛 | 博客
  • 博客访问: 290581
  • 博文数量: 49
  • 博客积分: 4776
  • 博客等级: 中校
  • 技术积分: 486
  • 用 户 组: 普通用户
  • 注册时间: 2005-03-02 10:42
文章分类

全部博文(49)

文章存档

2010年(6)

2009年(8)

2008年(20)

2007年(10)

2006年(2)

2005年(3)

分类:

2008-03-14 14:34:11

postfix的频率控制有几个:
smtpd_client_connection_rate_limit=5
ip地址连接的频率控制.
smtpd_client_message_rate_limit=5
客户端发送邮件的频率控制.(某种情况下smtpd_client_message_rate_limit和smtpd_client_connection_rate_limit的效果是一样.smtpd_client_connection_rate_limit是指连接到服务器25端口就开始计算,smtpd_client_message_rate_limit是发送邮件时计算.)

smtpd_client_recipient_rate_limit=10
rcpt to的频率控制,也就是说TO了多少个人.
smtpd_client_event_limit_exceptions(default: $mynetworks)
指不做频率控制检测的网络,默认是mynetworks.
 
如何在postfix中使用procmail
在main.cf中设置:
  mailbox_command = /path/to/procmail
  或者
  /etc/postfix/main.cf:
  mailbox_command = /path/to/procmail -a $EXTENSION
  如果可以的话,避免使用shell的关键字符,比如"$",IFS或者"&&",因为它们会迫使postfix运行一个shell进程。
 
 
利用postfix-pflogsumm来统计邮件系统的相关信息
[root@mail ~]# tail /etc/cron.daily/pflogsumm
#!/bin/sh
/usr/sbin/pflogsumm -d yesterday /var/log/maillog|mail -s "Yesterday Mail Report"
 
 
 
查postfix的版本号
postconf mail_version
 
 
postfix例外某些被列入rbl的IP地址
()
我在postfix里设置了rbl检查,我想问可不可以在postfix的main.cf里设置hash maps或者regrex maps例外某些被列入rbl的地址呢?

因为使用了rbl的确能把很多垃圾邮件地址挡掉,但我们公司有些客户的邮件系统地址也被列入rbl,申请撤离后没多久又被加入黑名单,故此想知道有没有办法可以既使用rbl功能,又对某些有用但被列入rbl的邮件地址进行例外通过。

之前用了一个办法: 将rbl整合到spamassassin里,不加到postfix直接当掉,但发现好像效果不佳,而且评分要抓的很小心。所以想问问有没有上面我所想的办法
 
测试发现不行。  我说说我的具体测试过程吧:

我的rbl check是加在 smtpd_recipient_restrictions 和 smtpd_client_restrictions 中,而我在此两项参数中加入了check_recipient_access regexp:/etc/postfix/pass_ip 和 check_client_access regexp:/etc/postfix/pass_ip , 形成以下配置参数。

smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access regexp:/etc/postfix/pass_ip, reject_unauth_destination, reject_non_fqdn_hostname, reject_unknown_sender_domain, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_invalid_hostname, reject_rbl_client cbl.anti-spam.org.cn=127.0.8.2, reject_rbl_client cdl.anti-spam.org.cn=127.0.8.4, reject_rbl_client cblplus.anti-spam.org.cn=127.0.8.6, reject_rbl_client cblless.anti-spam.org.cn=127.0.8.5

smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated, check_client_access regexp:/etc/postfix/pass_ip, reject_unknown_client, reject_rbl_client cbl.anti-spam.org.cn=127.0.8.2, reject_rbl_client cdl.anti-spam.org.cn=127.0.8.4, reject_rbl_client cblplus.anti-spam.org.cn=127.0.8.6, reject_rbl_client cblless.anti-spam.org.cn=127.0.8.5

我在/etc/postfix/pass_ip加入被列入RBL的IP地址。例如:(正则表示法)

/203.86.17.3$/      OK
/203.169.153.88$/   OK

运行:  /usr/sbin/postmap -q - regexp:/etc/postfix/pass_ip < /etc/postfix/pass_ip  和  /usr/sbin/postfix reload 后
被列入RBL的IP依然被挡了,是不是这个access表不应该加在那两个参数中啊? 应该加在sender check中?

好像应该使用的是check_sender_access而不是check_recipient_access和check_client_access,我先试试

实验证明,的确是用check_sender_access加在那两个参数里。而且maps里面的内容必须是邮件地址或域名

 

我还尝试了一个解决办法:
smtpd_restriction_classes = from_freemail_host

from_freemail_host = check_client_access hash:/etc/postfix/freemail_hosts, reject

smtpd_recipient_restrictions = check_sender_access hash:/etc/postfix/freemail_access

smtpd_client_restrictions = check_sender_access hash:/etc/postfix/freemail_access

 

/etc/postfix/freemail_access的格式
yahoo.com  from_freemail_host

/etc/postfix/freemail_hosts的格式:
yahoo.com  OK

以上办法证实是可行的,但要注意一点,如果你的postfix同时配置了防止假冒地址(Preventing sender spoofing)的话,以上动作会使从yahoo.com发过来的信都会显示:'554 5.7.1 <
>: Sender address rejected: Access denied'。

解决办法就是把yahoo.com的mx记录的ip地址也加入到freemail_access和freemail_hosts中去。

以上所说的方法同时适用于例外某些没有反解的但又需要正常联系的邮件地址。

 

 

 


 
 
 
 
阅读(1645) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~