您的位置:首页 > 其它

添加用户发送全员邮件权限

2017-01-17 10:17 351 查看
初始功能开启:以下用到的文件都在/etc/postfix下
1.# vi main.cf
添加下面几行:
#设置只能555@bobo365.comallstaff@bobo365.com 发邮件
smtpd_restriction_classes = local_only
local_only = check_sender_access hash:/etc/postfix/local_sender,reject
smtpd_sender_restrictions = check_recipient_accesshash:/etc/postfix/local_recipient
2.#vi local_sender
加入允许群发到all的邮件列表:
555@bobo365.com OK
333@bobo365.com OK
如果允许本域所有用户可以群发到all,则只添加
bobo365.com OK
即可。
3.# vi local_recipient
添加群账号:
allstaff@bobo365.com local_only
4.建立local_recipient和local_sender的hash表
# postmap hash:/etc/postfix/local_sender
# postmap hash:/etc/postfix/local_recipient
在/etc/postfix目录下生成2个db文件:
local_recipient.db和local_sender.db
5.重载Postfix
# /etc/init.d/postfix reload
6.测试:只有在local_sender里的用户才能给allstaff@bobo365.com群发,其他不受影响。——————————————————————–后期增加:1.#vi /etc/postfix/local_sender
加入允许群发到all的邮件列表:
king@bobo365.com OK2.更新数据库# postmap hash:/etc/postfix/local_sender3.重启Postfix
# /etc/init.d/postfix restart 升级篇:(支持多邮件列表) main.cf smtpd_restriction_classes = allow_to_all,allow_to_vm,allow_to_idc
allow_to_all = check_sender_access hash:/etc/postfix/allow_to_all, reject
allow_to_vm = check_sender_access hash:/etc/postfix/allow_to_vm, reject
allow_to_idc = check_sender_access hash:/etc/postfix/allow_to_idc, reject
smtpd_sender_restrictions =check_recipient_access hash:/etc/postfix/limit_sender_group
limit_sender_group allstaff@bobo365.com allow_to_all
wm-all@bobo365.com allow_to_vm
it-idc@bobo365.com allow_to_idc
allow_to_all fei@bobo365.com ok
da@bobo365.com ok

allow_to_vm xu@bobo365.com ok
xin@bobo365.com ok

allow_to_idc jin@bobo365.com ok
生成三个db文件
postmap hash:/etc/postfix/limit_sender_group
postmap hash:/etc/postfix/allow_to_all
postmap hash:/etc/postfix/allow_to_vm
postmap hash:/etc/postfix/allow_to_idc
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  用户 账号