DEV: Use nested form for `FreedomPatches` module

It seems that not using the nested form for the `FreedomPatches`
namespace is breaking stuff in some dev env.
This commit is contained in:
Loïc Guitaut 2022-06-08 14:53:37 +02:00 committed by Loïc Guitaut
parent c65c23b48d
commit 03732049ed
1 changed files with 10 additions and 8 deletions

View File

@ -6,16 +6,18 @@
# #
# This should be fixed in an upcoming release of the Mail gem (probably 2.8), # 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 # when this patch is merged: https://github.com/mikel/mail/pull/1435
module FreedomPatches::MailDisableStarttls module FreedomPatches
def build_smtp_session module MailDisableStarttls
super.tap do |smtp| def build_smtp_session
unless settings[:enable_starttls_auto] super.tap do |smtp|
if smtp.respond_to?(:disable_starttls) unless settings[:enable_starttls_auto]
smtp.disable_starttls if smtp.respond_to?(:disable_starttls)
smtp.disable_starttls
end
end end
end end
end end
end
::Mail::SMTP.prepend(self) ::Mail::SMTP.prepend(self)
end
end end