extmail 限制某些使用者發郵件到別名使用者

來源:互聯網
上載者:User

標籤: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 限制某些使用者發郵件到別名使用者

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.