mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 04:31:56 +08:00
03732049ed
It seems that not using the nested form for the `FreedomPatches` namespace is breaking stuff in some dev env.
24 lines
643 B
Ruby
24 lines
643 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Patch from
|
|
# https://github.com/rails/rails/issues/44698#issuecomment-1069675285 to enable
|
|
# previous behavior with Net::SMTP regarding TLS.
|
|
#
|
|
# This should be fixed in an upcoming release of the Mail gem (probably 2.8),
|
|
# when this patch is merged: https://github.com/mikel/mail/pull/1435
|
|
module FreedomPatches
|
|
module MailDisableStarttls
|
|
def build_smtp_session
|
|
super.tap do |smtp|
|
|
unless settings[:enable_starttls_auto]
|
|
if smtp.respond_to?(:disable_starttls)
|
|
smtp.disable_starttls
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
::Mail::SMTP.prepend(self)
|
|
end
|
|
end
|