1.修改postfix的設定檔main.cf
- 在"smtpd_sender_restrictions ="設定值內加入如下設定:
- 新增限制類別
local_only = check_recipient_access hash:/etc/postfix/local_domains, reject
2.編輯/etc/postfix/check_sender,將要限制的帳號指定到"local_only",帳號須包含網域名稱
u1@mydomain local_only
3.編輯/etc/postfix/local_domains,此處指定允許寄件的domain名稱
mydomain OK
4.執行postmap產生check_sender和local_domains的資料檔
postmap check_sender
postmap local_domains
5.重新啟動postfix
service postfix restart
以上!
參考資料:http://www.postfix.org/RESTRICTION_CLASS_README.html