mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-04 03:25:14 +00:00
Fix SMTP configuration with mail 2.9.0 (#36646)
This commit is contained in:
parent
2a9c7d2b9e
commit
e4291e9b05
3 changed files with 38 additions and 23 deletions
|
|
@ -8,25 +8,23 @@ module Mastodon
|
|||
# `config/email.yml`) into the format that `ActionMailer` understands
|
||||
def convert_smtp_settings(config)
|
||||
enable_starttls = nil
|
||||
enable_starttls_auto = nil
|
||||
|
||||
case config[:enable_starttls]
|
||||
when 'always'
|
||||
enable_starttls = true
|
||||
when 'never'
|
||||
enable_starttls = :always
|
||||
when 'never', 'false'
|
||||
enable_starttls = false
|
||||
when 'auto'
|
||||
enable_starttls_auto = true
|
||||
enable_starttls = :auto
|
||||
else
|
||||
enable_starttls_auto = config[:enable_starttls_auto] != 'false'
|
||||
enable_starttls = config[:enable_starttls_auto] ? :auto : false unless config[:tls] || config[:ssl]
|
||||
end
|
||||
|
||||
authentication = config[:authentication] == 'none' ? nil : (config[:authentication] || 'plain')
|
||||
|
||||
config.merge(
|
||||
config.without(:enable_starttls_auto).merge(
|
||||
authentication:,
|
||||
enable_starttls:,
|
||||
enable_starttls_auto:
|
||||
enable_starttls:
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue