Small improvement, set domain for smtp if Zammad fqdn is not configured (e. g. in development environments).
This commit is contained in:
parent
15a23f3723
commit
e16b3c3e48
1 changed files with 10 additions and 1 deletions
|
@ -31,7 +31,16 @@ class Channel::Driver::Smtp
|
|||
options[:port] = 25
|
||||
end
|
||||
if !options.key?(:domain)
|
||||
options[:domain] = Setting.get('fqdn')
|
||||
|
||||
# set fqdn, if local fqdn - use domain of sender
|
||||
fqdn = Setting.get('fqdn')
|
||||
if fqdn =~ /(localhost|\.local^|\.loc^)/i && (attr['from'] || attr[:from])
|
||||
domain = Mail::Address.new(attr['from'] || attr[:from]).domain
|
||||
if domain
|
||||
fqdn = domain
|
||||
end
|
||||
end
|
||||
options[:domain] = fqdn
|
||||
end
|
||||
if !options.key?(:enable_starttls_auto)
|
||||
options[:enable_starttls_auto] = true
|
||||
|
|
Loading…
Reference in a new issue