我想知道如何阻止我的用户发送邮件给对方,但给他们发送和接收外部邮件的机会。
[email protected] <—> [email protected] REJECT
[email protected] <—> [email protected]好的
[email protected] <—> [email protected]好的
我已经尝试configuration访问限制规则
/etc/postfix/main.cf: smtpd_recipient_restrictions = ... check_recipient_access hash:/etc/postfix/protected_destinations ...the usual stuff... smtpd_restriction_classes = insiders_only insiders_only = check_sender_access hash:/etc/postfix/insiders, reject /etc/postfix/protected_destinations: [email protected] insiders_only [email protected] insiders_only /etc/postfix/insiders: my.domain OK matches my.domain and subdomains another.domain OK matches another.domain and subdomains
但是,这并没有帮助本地发件人阻止本地收件人检查和本地收件人被阻止外部之前检查。
上面的configuration(显然来自该页面 )用于允许内部通信,并阻止电子邮件从外部到内部。
对于你的情况,你需要修改它
# /etc/postfix/main.cf: smtpd_recipient_restrictions = ... check_recipient_access hash:/etc/postfix/protected_destinations ...the usual stuff... smtpd_restriction_classes = reject_insiders reject_insiders = check_sender_access hash:/etc/postfix/insiders, permit # /etc/postfix/protected_destinations: localdomain1.example.com reject_insiders localdomain2.example.com reject_insiders # /etc/postfix/insiders: localdomain1.example.com REJECT local email isn't allowed localdomain2.example.com REJECT local email isn't allowed