限制部分用戶發送和接收外部郵件(已成功,大家分享)
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:
local_only
local_recipients:
local_only1
3) postmap hash:/etc/postfix/local_domains
postmap hash:/etc/postfix/local_senders
postmap hash:/etc/postfix/local_recipients
4) postfix reload
阅读(571) | 评论(0) | 转发(0) |