从Rails进行Exchange身份验证时无法识别的身份验证类型 [英] Unrecognized authentication type when doing an Auth to Exchange from Rails

查看:48
本文介绍了从Rails进行Exchange身份验证时无法识别的身份验证类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试从Ruby on Rails向Exchange Server进行身份验证时出现此错误:

I'm getting this error when trying to authenticate with Exchange Server from Ruby on Rails:

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

504 5.7.4 Unrecognized authentication type

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,以及将其完全删除,删除端口.什么都没有.

I've tried all sorts of combinations of configuration settings, including changing the settings to use "plain" authentication, adding the domain, setting enable_starttls_auto to true, false, and removing it entirely, removing the port. Nothing has worked.

有什么想法吗?

推荐答案

下面是来自链接:

轨道和Exchange电子邮件验证

1)将 ruby​​-ntlm gem添加到您的Gemfile中,然后运行捆绑安装.

1) Add the ruby-ntlm gem to your Gemfile and run bundle install.

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

2) Add the NTLM SMTP library to your config/environment.rb file.

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

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

3) Set up your environment file to authenticate with 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

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

****replace values with you own***

这篇关于从Rails进行Exchange身份验证时无法识别的身份验证类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆