postfix内部邮件管理的配置方法

发布时间:2020-06-24编辑:脚本学堂
postfix内部邮件管理的配置方法,有需要的朋友可以参考下。

postfix内部邮件管理的配置方法,有需要的朋友可以参考下。

邮件组限定修改顺序:
1)在main.cf里定义如下的smtpd_restriction_classes:
# restrictions--mail police
smtpd_restriction_classes = local_out_only local_in_only
local_out_only = check_recipient_access hash:/etc/postfix/local_domains, reject
local_in_only = check_sender_access hash:/etc/postfix/local_domains, reject

2)将main.cf里的smtpd_recipient_restrctions定义为:
smtpd_recipient_restrictions =
  check_sender_access hash:/etc/postfix/local_out_senders
  check_recipient_access hash:/etc/postfix/local_in_senders
  permit_mynetworks,
  permit_sasl_authenticated,
  reject_non_fqdn_hostname,
  reject_non_fqdn_sender,
  reject_non_fqdn_recipient,
  reject_unauth_destination,
  reject_unauth_pipelining,
  reject_invalid_hostname
  check_policy_service inet:127.0.0.1:10030

3)编辑/etc/postfix/local_in_senders:引用(每一行为一个邮件组):
all@oxoxoox.com  local_in_only
bpp@oxoxoox.com  local_in_only

4)编辑/etc/postifx/local_out_senders:
目前对于出去的组还没有限定,故为空!!此选项的意思是在oxoxoox邮件组里面有非oxoxoox.com.cn的邮箱时,比如有oxoxoox.com的邮箱,如果做了限定将会无法收到。

5)编辑/etc/postfix/local_domains:
oxoxoox.com.cn OK
oxoxoox.com OK

6)为3,4,5建立对应的hash文件:
# postmap hash:/etc/postfix/local_in_senders
# postmap hash:/etc/postfix/local_out_senders
# postmap hash:/etc/postfix/local_domains