(源自extmail.org)Postfix 限制部分用戶發送和接收外部郵件(未測試)

http://www.extmail.org/forum/thread-4102-1-1.html
1) 編輯main.cf,在最後添加
smtpd_restriction_classes = local_only,local_only1
local_only = check_recipient_access hash:/etc/postfix/local_domains,reject
local_only1 = check_sender_access hash:/etc/postfix/local_domains,reject
smtpd_recipient_restrictions = check_sender_access hash:/etc/postfix/local_senders,
 check_recipient_access hash:/etc/postfix/local_recipients,
 permit_mynetworks,
 permit_sasl_authenticated,
 reject_non_fqdn_hostname,
 reject_non_fqdn_sender,
 reject_non_fqdn_recipient,
 reject_unauth_destination,
 reject_unauth_pipelining,
 reject_rhsbl_sender,
 reject_unknown_sender_domain,
 reject_invalid_hostname
注:從第5行開始前面空一格.

2) 新增local-domains,local_senders,local_recipients
local_domains:
  domain.com OK
  192.168.0.1 OK
local_senders:
  Email住址會使用灌水程式保護機制。你需要啟動Javascript才能觀看它 local_only
local_recipients:
  Email住址會使用灌水程式保護機制。你需要啟動Javascript才能觀看它 local_only1

3)生成db
postmap hash:/etc/postfix/local_domains
postmap hash:/etc/postfix/local_senders
postmap hash:/etc/postfix/local_recipients

4)重啟postfix
postfix reload