免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2552 | 回复: 0
打印 上一主题 下一主题

[FreeBSD] amavisd-new 轉發郵件收到兩次的問題 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-11-24 20:30 |只看该作者 |倒序浏览
前段時間一直被轉發郵件收到兩次的問題困擾(postfix+amavisd-new)。今天終於找到問題所在,拿出來與大家分享。
原本我的main.cf裡面有以下參數:
content_filter = smtp-amavis:[127.0.0.1]:10024     #采用amavisd-new作內容過濾(spam virus)

master.cf 對應參數:
smtp-amavis unix - - n - 2 smtp
  -o smtp_data_done_timeout=1200
  -o disable_dns_lookups=yes
localhost:10025 inet n - n - - smtpd
  -o content_filter=
  -o local_recipient_maps=
  -o relay_recipient_maps=
  -o smtpd_restriction_classes=
  -o mynetworks=127.0.0.0/8      
  -o smtpd_client_restrictions=
  -o smtpd_helo_restrictions=
  -o smtpd_sender_restrictions=
  -o smtpd_recipient_restrictions=permit_mynetworks,reject
   -o smtpd_error_sleep_time=0
  -o smtpd_soft_error_limit=1001
  -o smtpd_hard_error_limit=1000
  -o strict_rfc821_envelopes=yes

當我從A用戶發一封郵件給B時(B設置了同時轉發給C),B正常收到1封,而C每次都收到同一封郵件兩次。
我嘗試mark調main.cf中的
content_filter = smtp-amavis:[127.0.0.1]:10024
參數,發現情況一切正常。由此發現問題出在:content_filter = smtp-amavis:[127.0.0.1]:10024 參數上。
通過查看postfix的幫助文檔發現有個參數:receive_override_options = no_address_mappings,意思是:
在進入內容過濾前不做地址展開/別名的解釋,(這個參數讓我好不興奮)。於是我在main.cf中加入 receive_override_options = no_address_mappings 參數。
postfix reload之後測試,發現發給B郵件沒有被轉發給C。細想發現是由於:receive_override_options = no_address_mappings
參數關閉了地址展開/別名解釋,於是想到應該是:要在內容過濾完後重新打開地址展開/別名解釋,所以修改master.cf(新增一行)
smtp-amavis unix - - n - 2 smtp
  -o smtp_data_done_timeout=1200
  -o disable_dns_lookups=yes
localhost:10025 inet n - n - - smtpd
  -o content_filter=
  -o local_recipient_maps=
  -o relay_recipient_maps=
  -o smtpd_restriction_classes=
  -o mynetworks=127.0.0.0/8      
  -o smtpd_client_restrictions=
  -o smtpd_helo_restrictions=
  -o smtpd_sender_restrictions=
  -o smtpd_recipient_restrictions=permit_mynetworks,reject
   -o smtpd_error_sleep_time=0
  -o smtpd_soft_error_limit=1001
  -o smtpd_hard_error_limit=1000
  -o strict_rfc821_envelopes=yes
-o receive_override_options =              #新加行

postfix reload 測試一切正常了。

[ 本帖最后由 @kang 于 2006-11-24 20:35 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP