您的位置:首页 > 大数据 > 人工智能

extmail 限制某些用户发邮件到别名用户

2014-09-02 17:35 281 查看
公司使用的邮局系统是extmail 架设的,最近有一个需求是:只允许有限的用户给别名用户发送邮件,别名邮箱即是群组邮箱,里面包含公司所有人员的邮箱地址,只要往这个别名邮箱发送邮件,大家就会都收到邮件;别名邮箱在给我方便的同时,即有一定的风险,即发垃圾邮件的只要往这个邮箱发送邮件,结果不堪设想,所以才有了上面的需求,废话少说,上配置方法:

一、环境
# lsb_release -a
LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 5.9 (Final)
Release: 5.9
Codename: Final

# getconf LONG_BIT
64

# rpm -qa | grep postfix
postfix-2.6.2-5hzq

二、配置
2.1 修改/etc/postfix/main.cf文件
添加如下两行:
smtpd_restriction_classes =xtone
xtone = check_sender_access hash:/etc/postfix/allow2all, reject

并在smtpd_sender_restrictions 部分修改为如下
smtpd_sender_restrictions =
check_recipient_access hash:/etc/postfix/xtome.com, (该行为新增)
permit_mynetworks,
reject_sender_login_mismatch,
reject_authenticated_sender_login_mismatch,
reject_unauthenticated_sender_login_mismatch

2.2 创建两个配置文件
# cd /etc/postfix

# cat allow2all
test@xtone.com ok

# cat xtone.com
xt.group@xtone.com xtone

2.3 对刚创建的两个文件制作hash文件

# postmap hash:/etc/postfix/allow2all

# postmap hash:/etc/postfix/xtone.com

三、重启服务

# service postfix restart

四、校验

上面配置的只允许 test@xtone.com 这个用户 往别名邮箱 xt.group@xtone.com 发送邮件;这时只要使用允许的邮箱(test@xtone.com )与其它未授权的邮箱往别名邮箱发送一封邮件测试一下即可;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息