mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-06 11:58:15 +08:00
Per [this topic](https://meta.discourse.org/t/struggling-to-configure-smtp-in-discourse-with-azure-communication-service/290511), Azure communication service requires the `login` authentication method on their SMTP service.
12 lines
526 B
Ruby
12 lines
526 B
Ruby
# frozen_string_literal: true
|
|
|
|
class SmtpProviderOverrides
|
|
# Ideally we (or net-smtp) would automatically detect the correct authentication
|
|
# method, but this is sufficient for our purposes because we know certain providers
|
|
# need certain authentication methods. This may need to change when we start to
|
|
# use XOAUTH2 for SMTP.
|
|
def self.authentication_override(host)
|
|
return "login" if %w[smtp.office365.com smtp-mail.outlook.com smtp.azurecomm.net].include?(host)
|
|
GlobalSetting.smtp_authentication
|
|
end
|
|
end
|