From aa4ade336e3a22182cec67445fa43d7d9f78f1ea Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Thu, 10 Feb 2022 13:09:57 +0100 Subject: [PATCH] Fixes #3956 - Migration of the MS365 account fails by upper and lower case... --- lib/external_credential/google.rb | 8 ++++---- lib/external_credential/microsoft365.rb | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/external_credential/google.rb b/lib/external_credential/google.rb index 10de9ec88..e141e2e24 100644 --- a/lib/external_credential/google.rb +++ b/lib/external_credential/google.rb @@ -85,10 +85,10 @@ class ExternalCredential::Google migrate_channel = nil Channel.where(area: 'Email::Account').find_each do |channel| - next if channel.options.dig(:inbound, :options, :user) != user_data[:email] - next if channel.options.dig(:inbound, :options, :host) != 'imap.gmail.com' - next if channel.options.dig(:outbound, :options, :user) != user_data[:email] - next if channel.options.dig(:outbound, :options, :host) != 'smtp.gmail.com' + next if channel.options.dig(:inbound, :options, :user)&.downcase != user_data[:email].downcase + next if channel.options.dig(:inbound, :options, :host)&.downcase != 'imap.gmail.com' + next if channel.options.dig(:outbound, :options, :user)&.downcase != user_data[:email].downcase + next if channel.options.dig(:outbound, :options, :host)&.downcase != 'smtp.gmail.com' migrate_channel = channel diff --git a/lib/external_credential/microsoft365.rb b/lib/external_credential/microsoft365.rb index ccf006341..f89172d7b 100644 --- a/lib/external_credential/microsoft365.rb +++ b/lib/external_credential/microsoft365.rb @@ -89,10 +89,10 @@ class ExternalCredential::Microsoft365 migrate_channel = nil Channel.where(area: 'Email::Account').find_each do |channel| - next if channel.options.dig(:inbound, :options, :user) != user_data[:email] - next if channel.options.dig(:inbound, :options, :host) != 'outlook.office365.com' - next if channel.options.dig(:outbound, :options, :user) != user_data[:email] - next if channel.options.dig(:outbound, :options, :host) != 'smtp.office365.com' + next if channel.options.dig(:inbound, :options, :user)&.downcase != user_data[:email].downcase + next if channel.options.dig(:inbound, :options, :host)&.downcase != 'outlook.office365.com' + next if channel.options.dig(:outbound, :options, :user)&.downcase != user_data[:email].downcase + next if channel.options.dig(:outbound, :options, :host)&.downcase != 'smtp.office365.com' migrate_channel = channel