方法一:
- [root@mail config]# pwd
- /usr/local/slockd/config
- [root@mail config]# ls -l
- total 40
- -rw-r--r--. 1 root root 4062 Apr 16 2006 blacklist
- -rw-r--r--. 1 root root 703 Oct 11 17:38 main.cf
- -rw-r--r--. 1 root root 2634 Oct 11 17:38 plugin.cf
- -rw-r--r--. 1 root root 340 Sep 14 2006 recip_blacklist
- -rw-r--r--. 1 root root 359 Jan 16 00:21 recip_whitelist
- -rw-r--r--. 1 root root 340 Sep 14 2006 sender_blacklist
- -rw-r--r--. 1 root root 359 Jan 16 00:30 sender_whitelist
- -rw-r--r--. 1 root root 237 Jun 3 2009 spamtrap_list
- -rw-r--r--. 1 root root 5933 Oct 19 23:27 whitelist
- #設置發送白名單
- [root@mail config]# vi sender_whitelist
- # the whitelist that won't be reject and process by any plugin
- # borrow from postgrey project, thanks the author!
- # the sample whitelist domain
- #@extmail.net
- # the sample whitelist domain in regexp
- #/^\@extmail\.org$/
- # the sample whitelist sender
- #[email protected]
- # the sample whitelist sender in regexp
- #/^\abuse\@hzqbbc\.com$/
- @hotmail.com
- #設置接受白名單
- [root@mail config]# vim recip_whitelist
- # the whitelist that won't be reject and process by any plugin
- # borrow from postgrey project, thanks the author!
- # the sample whitelist domain
- #@extmail.net
- # the sample whitelist domain in regexp
- #/^\@extmail\.org$/
- # the sample whitelist sender
- #[email protected]
- # the sample whitelist sender in regexp
- #/^\abuse\@hzqbbc\.com$/
- @hotmail.com
- @id.apple.com
- [root@mail config]# service postfix restart
- Shutting down postfix: [ OK ]
- Starting postfix: [ OK ]
方法二:
- [root@mail config]# vi /usr/local/slockd/config/plugin.cf
- # plugins configuration
- #
- # Author: He zhiqiang <[email protected]>
- # License: GPL v2
- # Date: 2009-05-14
- #----------------------#
- # global configuration #
- #----------------------#
- # debug or not?
- debug = yes
- debug_level = 1
- debug_method = stderr
- # Async DNS setting
- dns_max_retry = 3
- dns_max_resend = 3
- dns_timeout = 5
- # Policy action type, valid: policy|header|learn
- #
- # policy - will cause MTA to send DSN code to client
- # header - will cause MTA append a line to email header, it's for
- # debug purpose only.
- # learn - will redirect message to a spam filter to retrain
- action_type = policy
- # Action for Spam/Ham, this two parameters can setup a lot of
- # magic task for your content filter/bayes filtering system, or act
- # as standard policy server
- # action_spam - action to which identified as spam
- # action_spam = FILTER retrain:spam
- # action_ham - action to which identified as ham
- # action_ham = FILTER retrain:innocent
- #---------------#
- # plugin config #
- #---------------#
- # spamtrap plugin - a trap for spammer that collecting our trap address
- spamtrap_plugin = yes
- spamtrap_list = config/spamtrap_list
- spamtrap_action = FILTER spamtrap:
- # localctrl plugin - for white/black list
- localctrl_plugin = yes
- localctrl_bl = config/blacklist
- localctrl_wl = config/whitelist
- localctrl_sender_bl = config/sender_blacklist
- localctrl_sender_wl = config/sender_whitelist
- localctrl_recip_bl = config/recip_blacklist
- localctrl_recip_wl = config/recip_whitelist
- # the per user black/white list plugin
- peruserctrl_plugin = yes
- # the authlib socket path, use it if authlib enabled
- peruserctrl_sockpath = /var/spool/authdaemon/socket
- # the module to get user maildir path
- peruesrctrl_module = authlib
- # the SPF plugin
- spf_plugin = yes
- # set soft_reject to yes will reject the client with 450 instead
- # off 5xx smtp error code
- spf_soft_reject = no
- # default action to clients that neither fail nor pass
- spf_default_action = DUNNO
- # the RBL lookup plugin
- dnsbl_plugin = no
- # set soft_reject to yes will reject the client with 450 instead
- # off 5xx smtp error code
- dnsbl_soft_reject = no
- # rbl server list, using postfix style configuration
- # hints: trying dul.dnsbl.sorbs.net may block those dynamic IPs
- dnsbl_server_list =
- zen.spamhaus.org,
- bl.spamcop.net,
- cblplus.anti-spam.org.cn,
- dnsbl.sorbs.net,
- b.barracudacentral.org,
- dul.dnsbl.sorbs.net,
- hostkarma.junkemailfilter.com,
- # the Greaylist implemention plugin
- greylist_plugin = no
- # the greylist db full path, eg: (hash|btree):/path/to/greaylist.db
- greylist_db = /var/lib/greylist.db
- # the greylist delay time in seconds, default 300
- greylist_delay = 60
- [root@mail config]# service postfix restart
- Shutting down postfix: [ OK ]
- Starting postfix: [ OK ]