add smtp timeout

This commit is contained in:
Pete Matsyburka
2024-03-30 12:43:15 +02:00
parent 8269a61751
commit a73fd7929c
+5
View File
@@ -1,6 +1,9 @@
# frozen_string_literal: true
module ActionMailerConfigsInterceptor
OPEN_TIMEOUT = 15
READ_TIMEOUT = 25
module_function
def delivering_email(message)
@@ -43,6 +46,8 @@ module ActionMailerConfigsInterceptor
openssl_verify_mode: OpenSSL::SSL::VERIFY_NONE,
authentication: value.fetch('authentication', 'plain'),
enable_starttls_auto: true,
open_timeout: OPEN_TIMEOUT,
read_timeout: READ_TIMEOUT,
ssl: value['security'] == 'ssl',
tls: value['security'] == 'tls' || (value['security'].blank? && value['port'].to_s == '465')
}.compact_blank