EMOS添加白名單

方法一:

  1. [root@mail config]# pwd 
  2. /usr/local/slockd/config 
  3. [root@mail config]# ls -l 
  4. total 40 
  5. -rw-r--r--. 1 root root 4062 Apr 16  2006 blacklist 
  6. -rw-r--r--. 1 root root  703 Oct 11 17:38 main.cf 
  7. -rw-r--r--. 1 root root 2634 Oct 11 17:38 plugin.cf 
  8. -rw-r--r--. 1 root root  340 Sep 14  2006 recip_blacklist 
  9. -rw-r--r--. 1 root root  359 Jan 16 00:21 recip_whitelist 
  10. -rw-r--r--. 1 root root  340 Sep 14  2006 sender_blacklist 
  11. -rw-r--r--. 1 root root  359 Jan 16 00:30 sender_whitelist 
  12. -rw-r--r--. 1 root root  237 Jun  3  2009 spamtrap_list 
  13. -rw-r--r--. 1 root root 5933 Oct 19 23:27 whitelist 
  14. #設置發送白名單 
  15. [root@mail config]# vi sender_whitelist 
  16. # the whitelist that won't be reject and process by any plugin 
  17. # borrow from postgrey project, thanks the author! 
  18.  
  19. # the sample whitelist domain 
  20. #@extmail.net 
  21. # the sample whitelist domain in regexp 
  22. #/^\@extmail\.org$/ 
  23. # the sample whitelist sender 
  24. #[email protected] 
  25. # the sample whitelist sender in regexp 
  26. #/^\abuse\@hzqbbc\.com$/ 
  27. @hotmail.com 
  28. #設置接受白名單 
  29. [root@mail config]# vim recip_whitelist 
  30. # the whitelist that won't be reject and process by any plugin 
  31. # borrow from postgrey project, thanks the author! 
  32.  
  33. # the sample whitelist domain 
  34. #@extmail.net 
  35. # the sample whitelist domain in regexp 
  36. #/^\@extmail\.org$/ 
  37. # the sample whitelist sender 
  38. #[email protected] 
  39. # the sample whitelist sender in regexp 
  40. #/^\abuse\@hzqbbc\.com$/ 
  41. @hotmail.com 
  42. @id.apple.com 
  43. [root@mail config]# service postfix restart 
  44. Shutting down postfix: [ OK ] 
  45. Starting postfix: [ OK ] 

方法二:

 

  1. [root@mail config]# vi /usr/local/slockd/config/plugin.cf 
  2. # plugins configuration 
  3. # Author: He zhiqiang <[email protected]
  4. # License: GPL v2 
  5. Date: 2009-05-14 
  6.  
  7. #----------------------# 
  8. global configuration # 
  9. #----------------------# 
  10.  
  11. # debug or not
  12. debug = yes 
  13. debug_level = 1 
  14. debug_method = stderr 
  15.  
  16. # Async DNS setting 
  17. dns_max_retry = 3 
  18. dns_max_resend = 3 
  19. dns_timeout = 5 
  20.  
  21. # Policy action type, valid: policy|header|learn 
  22. # policy - will cause MTA to send DSN code to client 
  23. # header - will cause MTA append a line to email header, it's for 
  24. #          debug purpose only
  25. # learn  - will redirect message to a spam filter to retrain 
  26. action_type = policy 
  27.  
  28. Action for Spam/Ham, this two parameters can setup a lot of 
  29. # magic task for your content filter/bayes filtering system, or act 
  30. as standard policy server 
  31.  
  32. # action_spam - action to which identified as spam 
  33. # action_spam = FILTER retrain:spam 
  34. # action_ham  - action to which identified as ham 
  35. # action_ham = FILTER retrain:innocent 
  36.  
  37. #---------------# 
  38. # plugin config # 
  39. #---------------# 
  40.  
  41. # spamtrap plugin - a trap for spammer that collecting our trap address 
  42. spamtrap_plugin = yes 
  43. spamtrap_list = config/spamtrap_list 
  44. spamtrap_action = FILTER spamtrap: 
  45.  
  46. # localctrl plugin - for white/black list 
  47. localctrl_plugin = yes 
  48. localctrl_bl = config/blacklist 
  49. localctrl_wl = config/whitelist 
  50. localctrl_sender_bl = config/sender_blacklist 
  51. localctrl_sender_wl = config/sender_whitelist 
  52. localctrl_recip_bl = config/recip_blacklist 
  53. localctrl_recip_wl = config/recip_whitelist 
  54.  
  55. # the per user black/white list plugin 
  56. peruserctrl_plugin = yes 
  57. # the authlib socket path, use it if authlib enabled 
  58. peruserctrl_sockpath = /var/spool/authdaemon/socket 
  59. # the module to get user maildir path 
  60. peruesrctrl_module = authlib 
  61.  
  62. # the SPF plugin 
  63. spf_plugin = yes 
  64. set soft_reject to yes will reject the client with 450 instead 
  65. off 5xx smtp error code 
  66. spf_soft_reject = no 
  67. default action to clients that neither fail nor pass 
  68. spf_default_action = DUNNO 
  69.  
  70. # the RBL lookup plugin 
  71. dnsbl_plugin = no 
  72. set soft_reject to yes will reject the client with 450 instead 
  73. off 5xx smtp error code 
  74. dnsbl_soft_reject = no 
  75. # rbl server list, using postfix style configuration 
  76. # hints: trying dul.dnsbl.sorbs.net may block those dynamic IPs 
  77. dnsbl_server_list = 
  78.   zen.spamhaus.org, 
  79.   bl.spamcop.net, 
  80.   cblplus.anti-spam.org.cn, 
  81.   dnsbl.sorbs.net, 
  82.   b.barracudacentral.org, 
  83.   dul.dnsbl.sorbs.net, 
  84.   hostkarma.junkemailfilter.com, 
  85.  
  86. # the Greaylist implemention plugin 
  87. greylist_plugin = no 
  88. # the greylist db full path, eg: (hash|btree):/path/to/greaylist.db 
  89. greylist_db = /var/lib/greylist.db 
  90. # the greylist delay time in seconds, default 300 
  91. greylist_delay = 60 
  92.  
  93. [root@mail config]# service postfix restart 
  94. Shutting down postfix: [ OK ] 
  95. Starting postfix: [ OK ] 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章