postfix限制某些用户外发邮件(只能给规定的域发邮件)

2268阅读 3评论2006-11-17 枫影谁用了
分类:LINUX

在main.cf里文件里添加如下配置
 
smtpd_recipient_restrictions项添加

check_sender_access hash:/etc/postfix/restricted_senders

在main.cf文件里添加

smtpd_restriction_classes = local_only
local_only = check_recipient_access hash:/etc/postfix/local_domains,reject

 

接着建立/etc/postfix/restricted_senders和/etc/postfix/local_domains文件,restricted_senders为限制的用户列表,格式以下,一个用户一行

yglu@ local_only
fisarx@ local_only
gczhou@ local_only

 

local_domains文件为允许那些用户发的域,一个域一行,格式如下

longsure.com.hk ok
hongkongtoy.com ok
zizzle.com.hk ok
playwell.com.cn ok

然后用postmap生成postfix认识的库文件

postmap hash:/etc/postfix/restricted_senders
postmap hash:/etc/postfix/local_domains

 

然后重新加载postfix.

postfix reload

上一篇:Postfix本身的功能,可以将某个用户发出的信转寄给其它用户
下一篇:FVWM的一些中文解释

文章评论