標籤:extmail 郵箱 限制發送 別名郵箱
公司使用的郵局系統是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
[email protected] ok
# cat xtone.com
[email protected] xtone
2.3 對剛建立的兩個檔案製作hash檔案
# postmap hash:/etc/postfix/allow2all
# postmap hash:/etc/postfix/xtone.com
三、重啟服務
# service postfix restart
四、校正
上面配置的只允許 [email protected] 這個使用者 往別名郵箱 [email protected] 發送郵件;這時只要使用允許的郵箱([email protected] )與其它未授權的郵箱往別名郵箱發送一封郵件測試一下即可;
本文出自 “方寸小山” 部落格,請務必保留此出處http://523514.blog.51cto.com/513514/1547958
extmail 限制某些使用者發郵件到別名使用者