【问题标题】:Unrecognized authentication type when doing an Auth to Exchange from Rails从 Rails 对 Exchange 进行身份验证时无法识别身份验证类型
【发布时间】:2011-12-24 02:50:38
【问题描述】:

我在尝试通过 Ruby on Rails 向 Exchange Server 进行身份验证时遇到此错误:

504 5.7.4 无法识别的身份验证 输入

config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_deliveries = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
  :address              => "x.x.x.x",
  :port                 => 25,
  :user_name            => "xxdomain\xxuser",
  :password             => "xxxxxx",
  :authentication       => :login,
  :enable_starttls_auto => true
}

我尝试了各种配置设置组合,包括更改设置以使用“普通”身份验证、添加域、将 enable_starttls_auto 设置为 true、false,以及完全删除它、删除端口。没有任何效果。

有什么想法吗?

【问题讨论】:

标签: ruby-on-rails exchange-server


【解决方案1】:

以下来自链接:

Rails and Exchange Email Auth

1) 将 ruby-ntlm gem 添加到您的 Gemfile 并运行 bundle install

2) 将 NTLM SMTP 库添加到您的 config/environment.rb 文件中。

# Load the rails application
  require File.expand_path('../application', __FILE__)
  require 'ntlm/smtp'
# Initialize the rails application
  RailsApp::Application.initialize! 

3) 设置您的环境文件以通过 NTLM 进行身份验证。

config.active_support.deprecation = :notify
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
 :address => '<your-email-server>',
 :domain => '<your-domain>',
 :user_name => '<your-username>',
 :password => '<your-unencrypted-password>',
 :port => 25,
 :authentication => :ntlm

****用你自己的值替换值***

【讨论】:

  • 欢迎来到 Stack Overflow!虽然这在理论上可以回答这个问题,it would be preferable 在这里包括答案的基本部分,并提供参考链接。
  • 请修复链接。这是死亡
猜你喜欢
  • 1970-01-01
  • 2011-08-04
  • 1970-01-01
  • 2015-11-02
  • 2013-05-30
  • 1970-01-01
  • 2015-09-23
  • 1970-01-01
  • 2016-01-11
相关资源
最近更新 更多