Net::SMTPAuthenticationError (530 5.7.0 必须先发出 STARTTLS 命令

Jed*_*ter 5 ruby-on-rails-3.2

我正在运行 Mac OSX Mountain Lion

红宝石:红宝石 1.9.2p290(2011-07-09 修订版 32553)[x86_64-darwin12.1.0]

导轨:导轨 3.2.3

我有我的配置/环境/development.rb:

MyApp::Application.configure 做

  config.cache_classes = false
  config.whiny_nils = true
  config.consider_all_requests_local       = true
  config.action_controller.perform_caching = false
  config.active_support.deprecation = :log
  config.action_dispatch.best_standards_support = :builtin
  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
    address: "smtp.gmail.com",
    port: 587,
    domain: "gmail.com",
    authentication: :login,
    enable_starttls_auto: true,
    openssl_verify_mode: OpenSSL::SSL::VERIFY_NONE,
    user_name: "username",
    password: "password"
  }

  config.action_mailer.default_url_options = {host: 'localhost:3000'}
end
Run Code Online (Sandbox Code Playgroud)

这在 2 周前有效,代码尚未更改。然而,从那以后我升级为山狮。我们还为 Git 添加了一个名为 staging 的额外钩子,但这不应该影响它。今天早上遇到这个问题后,我在代码中添加了如下所示的行:

  openssl_verify_mode: OpenSSL::SSL::VERIFY_NONE
Run Code Online (Sandbox Code Playgroud)

我在另一篇关于这个问题的帖子中看到过。这没用。

动作邮件程序在测试器和生产服务器上运行良好,所以我们现在确信这是升级到 Lion 的问题。

感谢您的时间。