Postfix,Centos,DoveCot,Google Mail Relay

时间:2014-11-07 20:16:05

标签: email gmail postfix-mta sasl dovecot

我在CENTOS上设置Postfix / Dovecot邮件服务器,我发送并使用网络邮件接收电子邮件,我也可以使用谷歌设置从服务器提取电子邮件没问题,但是当我尝试使用电子邮件从谷歌发送电子邮件时来自邮件服务器的地址不是我的gmail我得到554中继访问被拒绝错误

output of postconf -n
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
disable_vrfy_command = yes
enable_original_recipient = no
header_checks = regexp:/etc/postfix/header_checks
inet_interfaces = all
local_recipient_maps = 
mailbox_size_limit = 0
maximal_backoff_time = 8000s
maximal_queue_lifetime = 7d
minimal_backoff_time = 1000s
mydestination = $mydomain
myhostname = mail.mainewarmers.com
mynetworks = 127.0.0.0/8, <site IP>, [::1]/128, 209.85.216.43
mynetworks_style = host
myorigin = $mydomain
readme_directory = no
recipient_delimiter = +
smtp_helo_timeout = 60s
smtp_tls_note_starttls_offer = yes 
smtp_tls_security_level = may
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_client_restrictions = reject_rbl_client sbl.spamhaus.org, reject_rbl_client      
blackholes.easynet.nl, reject_rbl_client dnsbl.njabl.org
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_delay_reject = yes
smtpd_hard_error_limit = 12
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks, warn_if_reject reject_non_fqdn_hostname,   reject_invalid_hostname, permit
smtpd_recipient_limit = 16
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = 
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks,   warn_if_reject reject_non_fqdn_sender, reject_unknown_sender_domain,   reject_unauth_pipelining, permit
smtpd_soft_error_limit = 3
smtpd_tls_cert_file = /etc/postfix/cert.pem
smtpd_tls_key_file = /etc/postfix/key.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 450
virtual_alias_maps = hash:/etc/postfix/virtual\

telnet到端口25工作得很好,就像那样 openssl s_client -connect mail.mainewarmers.com:25 -starttls smtp

但是,每当我尝试使用我的Google帐户向外部电子邮件地址发送电子邮件时

永久性失败的技术细节: 谷歌试图传递你的消息,但邮件被mail.mainewarmers.com拒绝接收mail.mainewarmers.com。 [54.164.102.132]。

其他服务器返回的错误是: 554 5.7.1:拒绝中继访问

maillog给了我这个

Nov  7 19:54:39 ip-172-31-17-198 postfix/smtpd[5046]: NOQUEUE: reject: RCPT from   mail-qg0-f43.google.com[209.85.192.43]: 554 5.7.1 <a@mail>: Relay access denied;  from=<bhanscom@mainewarmers.$
Nov  7 19:54:39 ip-172-31-17-198 postfix/smtpd[5046]: disconnect from mail-qg0-f43.google.com[209.85.192.43]

我已经过了我的postconf并设置了最近5个小时,我没有看到任何错误,有人能指出我正确的方向吗?谢谢你!

1 个答案:

答案 0 :(得分:-1)

修好了, 使用dig和ns找到ips google用来发送mai,将其添加到mynetworks。 一整天都像魅力一样