Postfix 不工作

Postfix 不工作

不久前,我在我的 ubuntu 10.04 VPS 上安装了 postfix 邮件服务器。当时它运行良好,但现在却停止工作了。我试图启用 SASL 身份验证,但一定是哪里出了问题。我研究了 postfix main.cf,并按部就班地完成了所有工作,以确保没有问题。我还安装了 Dovecot 并配置了 dovecot.conf 以与 Postfix 一起运行。

如果我在登录服务器时尝试执行 telnet localhost 25,我只会得到:外部主机关闭连接。

如果我尝试“从外部”执行 telnet mail.example.com 25,我会得到:telnet:无法连接到远程主机:没有到主机的路由

当我在尝试失败后检查服务器日志时,我看到了以下内容:

Jun 28 15:49:31 msv postfix/smtpd[11839]: initializing the server-side TLS engine
Jun 28 15:49:31 msv postfix/smtpd[11839]: connect from localhost.localdomain[127.0.0.1]
Jun 28 15:49:31 msv postfix/smtpd[11839]: warning: SASL: Connect to /var/spool/postfix/private/auth failed: Connection refused
Jun 28 15:49:31 msv postfix/smtpd[11839]: fatal: no SASL authentication mechanisms
Jun 28 15:49:32 msv postfix/master[11598]: warning: process /usr/lib/postfix/smtpd pid 11839 exit status 1
Jun 28 15:49:32 msv postfix/master[11598]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling

main.cf 文件如下所示:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no
append_dot_mydomain = no
delay_warning_time = 4h
myhostname = mail.example.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydomain = example.com
myorigin = $mydomain
mydestination = $mydomain
relayhost =
mynetworks = 127.0.0.1
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
smtpd_use_tls = yes
smtpd_tls_loglevel = 2
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_sasl_auth_enable = yes
smtpd_client_restrictions = permit_sasl_authenticated, permit_mynetworks,  reject_unauth_destination
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks
smtpd_recipient_restrictions = permit_sasl_authenticated, reject_unauth_destination broken_sasl_auth_clients = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = /var/spool/postfix/private/auth
smtpd_sasl_security_options = noanonymous 

Dovecot.conf 文件如下所示:

protocols = imap imaps
disable_plaintext_auth = no
log_timestamp = "%b %d %H:%M:%S "
ssl = yes
ssl_cert_file = /etc/postfix/ssl/smtpd.crt
ssl_key_file = /etc/postfix/ssl/smtpd.key
mail_location = maildir:~/mail
mail_access_groups = mail
auth_username_chars = abcdefghijklmnopqrstuvwxyz
protocol imap {
imap_client_workarounds = delay-newmail tb-extra-mailbox-sep
}

auth default {
mechanisms = plain login
  passdb pam {
  }
  userdb passwd {
  }
  socket listen {
      client {
      path = /var/spool/postfix/private/auth
      user = postfix
      group = postfix
      mode = 0660
    }
  }
}

答案1

我认为您要么需要禁用 sasl:

smtpd_sasl_auth_enable = no

或者,您需要启用(启动)saslauthd。完成上述任一操作后,您应该解决:

Jun 28 15:49:31 msv postfix/smtpd[11839]: warning: SASL: Connect to /var/spool/postfix/private/auth failed: Connection refused

答案2

检查文件的权限/var/spool/postfix/private/auth。sasl 用户应该可以访问它。这让我想起了上次设置 sasl 服务器时的经历。

相关内容