在STARTTLS:Postfix之后丢失了连接

我已经安装了Postfix + Courier服务器,并configuration了使用SMTP服务器设置的Rails应用程序。 每当Rails应用程序尝试发送电子邮件时,这就是Postfix日志中显示的内容(master.cf中设置的其他日志详细程度)

Feb 22 03:57:24 alpha postfix/smtpd[1601]: Anonymous TLS connection established from localhost[127.0.0.1]: TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits) Feb 22 03:57:24 alpha postfix/smtpd[1601]: smtp_get: EOF Feb 22 03:57:24 alpha postfix/smtpd[1601]: match_hostname: localhost ~? 127.0.0.0/8 Feb 22 03:57:24 alpha postfix/smtpd[1601]: match_hostaddr: 127.0.0.1 ~? 127.0.0.0/8 Feb 22 03:57:24 alpha postfix/smtpd[1601]: lost connection after STARTTLS from localhost[127.0.0.1] Feb 22 03:57:24 alpha postfix/smtpd[1601]: disconnect from localhost[127.0.0.1] Feb 22 03:57:24 alpha postfix/smtpd[1601]: master_notify: status 1 Feb 22 03:57:24 alpha postfix/smtpd[1601]: connection closed 

任何想法,为什么它authentication后失去连接?

也许rails应用程序不信任后缀证书?

ActionMailer已更改为更安全的默认configuration,并在TLS模式下检查服务器证书(从版本2开始 – 3或3)。

一些解决scheme是:

  • 在应用中恢复旧的Rails行为:将openssl_verify_mode: 'none'添加到Railsconfiguration
  • 禁用服务器上的TLS:在您的Postfixconfiguration中设置smtpd_use_tls=no
  • 在服务器上设置有效的TLS证书,这些证书可以在客户端(Rails应用程序)上使用证书颁发机构进行validation。 这可能是矫枉过正,如果它是在这个例子中似乎是这样的服务器,但是这种configuration,你将要确保smtpd不听一个公共端口。