Fixes #3956 - Migration of the MS365 account fails by upper and lower case differences in email address.

This commit is contained in:
Rolf Schmidt 2022-02-10 12:38:31 +01:00
parent b61a3989dc
commit 0b449839ea
2 changed files with 8 additions and 8 deletions

View file

@ -85,10 +85,10 @@ class ExternalCredential::Google
migrate_channel = nil migrate_channel = nil
Channel.where(area: 'Email::Account').find_each do |channel| 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, :user)&.downcase != user_data[:email].downcase
next if channel.options.dig(:inbound, :options, :host) != 'imap.gmail.com' next if channel.options.dig(:inbound, :options, :host)&.downcase != 'imap.gmail.com'
next if channel.options.dig(:outbound, :options, :user) != user_data[:email] next if channel.options.dig(:outbound, :options, :user)&.downcase != user_data[:email].downcase
next if channel.options.dig(:outbound, :options, :host) != 'smtp.gmail.com' next if channel.options.dig(:outbound, :options, :host)&.downcase != 'smtp.gmail.com'
migrate_channel = channel migrate_channel = channel

View file

@ -89,10 +89,10 @@ class ExternalCredential::Microsoft365
migrate_channel = nil migrate_channel = nil
Channel.where(area: 'Email::Account').find_each do |channel| 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, :user)&.downcase != user_data[:email].downcase
next if channel.options.dig(:inbound, :options, :host) != 'outlook.office365.com' next if channel.options.dig(:inbound, :options, :host)&.downcase != 'outlook.office365.com'
next if channel.options.dig(:outbound, :options, :user) != user_data[:email] next if channel.options.dig(:outbound, :options, :user)&.downcase != user_data[:email].downcase
next if channel.options.dig(:outbound, :options, :host) != 'smtp.office365.com' next if channel.options.dig(:outbound, :options, :host)&.downcase != 'smtp.office365.com'
migrate_channel = channel migrate_channel = channel