/var/log/邮件日志

/var/log/邮件日志

我在 AMI Linux 上运行 Postfix 2.6.6。此 Postfix 服务器的用途是:

1) 为网络上的客户端计算机发送邮件。

2)接收来自不同用户名和域名的电子邮件地址的外部电子邮件,并将这些电子邮件转发到另一个外部电子邮件地址。例如,未知用户向[电子邮件保护]然后 Postfix 将其转发到[电子邮件保护]

#1 工作正常。但是,每当任何外部用户发送电子邮件到[电子邮件保护],Postfix 给出“中继访问被拒绝”消息。

以下是日志:

/var/log/邮件日志

Oct 15 18:53:21 mx postfix/smtpd[14196]: connect from mail-wm0-f51.google.com[74.125.82.51]
Oct 15 18:53:21 mx postfix/smtpd[14196]: NOQUEUE: reject: RCPT from mail-wm0-f51.google.com[74.125.82.51]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail-wm0-f51.google.com>
Oct 15 18:53:21 mx postfix/smtpd[14196]: disconnect from mail-wm0-f51.google.com[74.125.82.51]

以下是配置文件中的设置:

后配置-n

alias_database = hash:/etc/mail/aliases
alias_maps = hash:/etc/mail/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
inet_protocols = all
local_header_rewrite_clients = permit_inet_interfaces permit_mynetworks
local_transport = error:local delivery is disabled
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
masquerade_domains = websrvcs.myowndomain.ca
milter_default_action = accept
milter_protocol = 6
mydestination = localhost
mynetworks = 127.0.0.0/8 [::1]/128 10.0.19.40/32
newaliases_path = /usr/bin/newaliases.postfix
non_smtpd_milters = $smtpd_milters
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_generic_maps = pgsql:/etc/postfix/pgsql-generic.cf
smtp_header_checks = regexp:/etc/postfix/smtp_header_checks
smtpd_helo_required = yes
smtpd_milters = inet:127.0.0.1:57320
smtpd_tls_CAfile = /etc/letsencrypt/live/mx.myowndomain.ca/chain.pem
smtpd_tls_cert_file = /etc/letsencrypt/live/mx.myowndomain.ca/cert.pem
smtpd_tls_key_file = /etc/letsencrypt/live/mx.myowndomain.ca/privkey.pem
smtpd_tls_security_level = may
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual

/etc/mail/别名

postmaster: ec2-user
root: ec2-user

/etc/postfix/pgsql-generic.cf

hosts = pgsql.myowndomain.ca:theport
user = postfix
password = password
dbname = thedb
query = SELECT result FROM postfix.generic WHERE '%s' ~* pattern LIMIT 1;

在 /etc/postfix/smtp_header_checks 中

/^Received:/ IGNORE
/^Sender:/ IGNORE

/etc/postfix/虚拟

[email protected]           [email protected]
...other entries

我花了很多时间排除故障并寻找答案,但似乎我能找到的所有以前的帖子都与我的情况略有不同。现在我不知所措。

答案1

您的 postfix 无法识别它应该接受发往 example.com 的电子邮件进行传送,它认为 gmail 正尝试使用您的电子邮件服务器作为中继。

看一下http://www.postfix.org/postconf.5.html#mydestination并添加域名example.com。

相关内容