邮件服务器将发出邮件但不会接收

邮件服务器将发出邮件但不会接收

我刚刚用 Postfix 和 Dovecot 设置了我的第一个邮件服务器。我可以正常发送邮件(通过 Squirrel Mail),但无法接收邮件。Pingability 告诉我,ConnectException: Connection refused但我的防火墙没有阻止端口 25。我怀疑这与我的 Postfix 配置文件有关:

  smtpd_sasl_auth_enable = yes
  smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
  smtpd_sasl_security_options = noanonymous
  smtpd_sasl_type = dovecot
  smtpd_sasl_path = private/auth
  queue_directory = /var/spool/postfix
  command_directory = /usr/sbin
  daemon_directory = /usr/libexec/postfix      
  mail_owner = postfix
  myhostname = mail.myserver(i've blanked this out).com
  mydomain = myserver(i've blanked this out).com
  myorigin = $mydomain
  inet_interfaces = all
  mydestination = $myhostname, $mydomain,
  unknown_local_recipient_reject_code = 550
  alias_maps = hash:/etc/aliases
  alias_database = hash:/etc/aliases
  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
  readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES

答案1

连接被拒绝错误意味着端口已关闭(没有监听服务)。您应该确保您的 postfix 进程正在运行并监听端口 25。

您可以使用:

sudo netstat -lnp | grep 25

您应该会在输出中看到列出的 postfix 进程。此外,如果您可以访问服务器,还可以查看 mail.log 文件以获得更好的诊断。

编辑:

Postfix 进程不应仅监听本地地址 127.0.0.1。否则,它将无法从网络访问。要检查这一点,请查看 postfix 配置中的以下行:

inet_interfaces = localhost
inet_interfaces = 127.0.0.1

相关内容