Skip to content

Commit

Permalink
Omit nil SMTP settings
Browse files Browse the repository at this point in the history
Allows leaving `smtp_settings[:domain]` unspecified. Explicitly setting
it to `nil` (as when `OSEM_SMTP_DOMAIN` is unset) overrides the default
value of `'localhost.localdomain'` and caused SMTP connections to fail
with `EOFError`.
  • Loading branch information
AndrewKvalheim committed Nov 2, 2020
1 parent ae98ac1 commit e530fbe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
domain: ENV['OSEM_SMTP_DOMAIN'],
enable_starttls_auto: ENV['OSEM_SMTP_ENABLE_STARTTLS_AUTO'],
openssl_verify_mode: ENV['OSEM_SMTP_OPENSSL_VERIFY_MODE']
}
}.compact

# Set the secret_key_base from the env, if not set by any other means
config.secret_key_base ||= ENV["SECRET_KEY_BASE"]
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/migrate_config.rake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace :data do
dot_env.puts "OSEM_SMTP_USERNAME=\"#{CONFIG['mail_username']}\""
dot_env.puts "OSEM_SMTP_PASSWORD=\"#{CONFIG['mail_password']}\""
dot_env.puts "OSEM_SMTP_AUTHENTICATION=\"#{CONFIG['mail_authentication']}\""
dot_env.puts 'OSEM_SMTP_DOMAIN=""'
dot_env.puts '# OSEM_SMTP_DOMAIN="example.com"'
dot_env.close

puts "Migrated config/config.yml to .env.#{Rails.env}"
Expand Down

0 comments on commit e530fbe

Please sign in to comment.