我遇到了所有 Postfix 邮件都被拒绝的问题,并显示“中继访问被拒绝” - Centos 6.5,postfix 2.6.6

我遇到了所有 Postfix 邮件都被拒绝的问题,并显示“中继访问被拒绝” - Centos 6.5,postfix 2.6.6

如果我使用smtpd_recipient_restrictions,所有内容都会被拒绝,并显示“中继访问被拒绝”。如果我使用smtpd_relay_restrictions,所有内容都会通过并忽略白名单。不知道发生了什么;smtpd_recipient_restrictions在旧版本的 postfix 上运行良好。配置如下:

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
myhostname = staging.domain.local
inet_interfaces = localhost
mydestination = $myhostname, localhost.$mydomain, localhost
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
unknown_local_recipient_reject_code = 550
mynetworks = 192.168.11.0/24,10.1.25.0/24,127.0.0.0/8
relayhost = outgoing-mx.domain.local
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
recipient_delimiter = +
debug_peer_level = 2
debugger_command =
     PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
     xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.3.3/samples
smtpd_recipient_restrictions =
    check_recipient_access hash:/etc/postfix/whitelist_recipient
    reject_unauth_destination
    reject_invalid_hostname
    reject_non_fqdn_sender
    reject_non_fqdn_hostname
    reject_unknown_sender_domain
    permit

答案1

将行“permit_mynetworks”添加到限制中以允许发送邮件。

 smtpd_recipient_restrictions =
    check_recipient_access hash:/etc/postfix/whitelist_recipient
    permit mynetworks
    reject_unauth_destination
    reject_invalid_hostname
    reject_non_fqdn_sender
    reject_non_fqdn_hostname
    reject_unknown_sender_domain
    permit

相关内容