Postfix/Dovecot 无法接收来自外部来源的电子邮件

Postfix/Dovecot 无法接收来自外部来源的电子邮件

帮助!哈哈。我最近是个傻瓜,把我的服务器搞坏了。我有一个邮件服务器在服务器上运行。在我的新服务器上,我试图重新设置它,但无法让它工作。我的配置和以前几乎一模一样。一切都正常,只是我无法从外部来源接收电子邮件。我可以发送电子邮件,我可以从我自己的主机接收表单,只是不能从另一个主机接收。我已经搜索了几天才找到我所在的地方。我只想放弃。

编辑:补充一下,我还可以通过 Outlook 进行外部连接以接收和发送邮件。如果我通过 Outlook 向自己发送电子邮件,则一切正常。这不是我的防火墙或 MX 记录的问题。

我尝试从外部来源发送电子邮件时收到的错误是

远程服务器返回“554 5.7.1:收件人地址被拒绝:访问被拒绝”

编辑:还发现此错误:

3 月 16 日 19:28:30 mydomain postfix/smtpd[28215]: 从 mail-ob0-f179.google.com[209.85.214.179] 连接 3 月 16 日 19:28:31 mydomain postfix/smtpd[28215]: 从 mail-ob0-f179.google.com[209.85.214. 179]: 使用密码 ECDHE-RSA-RC4-SHA (128/128 位) 的 TLSv1 3 月 16 日 19:28:31 mydomain postfix/smtpd[28215]: NOQUEUE: 拒绝:来自 mail-ob0-f179.google.com[209.85.214.179] 的 RCPT: 554 5.7.1:收件人地址被拒绝:拒绝访问;来自= 到= proto=ESMTP helo=

后配置-n

alias_database = $alias_maps
alias_maps = hash:/etc/postfix/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/bin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
home_mailbox = .mail/
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain, www.$mydomain, ftp.$mydomain
mydomain = mydomain.net
myhostname = mail.mydomain.net
mynetworks = 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
relay_domains =
sample_directory = /etc/postfix/sample
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks, check_relay_domains
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_CAfile = /path/to/ca
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /path/to/cert
smtpd_tls_key_file = /path/to/key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:/var/spool/postfix/smtpd_tls_cache
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550

doveconf-n

# 2.2.11: /etc/dovecot/dovecot.conf
# OS: Linux 3.10.33-1-lts x86_64
auth_mechanisms = plain login
disable_plaintext_auth = no
log_path = /var/log/dovecot.log
mail_location = maildir:~/.mail
mbox_write_locks = fcntl
passdb {
  driver = pam
}
protocols = imap pop3
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  unix_listener auth-userdb {
    group = postfix
    mode = 0660
    user = postfix
  }
}
service imap-login {
  inet_listener imap {
    port = 143
  }
  inet_listener imaps {
    port = 993
    ssl = yes
  }
}
ssl_cert = </path/to/cert
ssl_key = </path/to/key
userdb {
  driver = passwd
}
protocol pop3 {
  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
  pop3_uidl_format = %08Xu%08Xv
}

答案1

我怀疑问题是你正在使用 check_relay_domains - 我相信这已经已弃用(和这里)并且现在您使用“reject_unauth_destination”作为 smtpd_recipient_restrictions

相关内容