Unrecognized authentication type when authenticating with Exchange from Rails

I get this error when trying to authenticate with Exchange Server with Ruby on Rails:

504 5.7.4 Unidentified 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
}

I tried all kinds of combinations of configuration parameters, including changing the settings to use "simple" authentication, adding a domain, setting enable_starttls_auto to true, false, and deleting completely, deleting the port. Nothing worked.

Any ideas?

+3
source share
1 answer

Below is the link:

Rails and Exchange Email Auth

1) ruby-ntlm Gemfile .

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

**** ***

+7

All Articles