diff --git a/app/controllers/smtp_config_controller.rb b/app/controllers/smtp_config_controller.rb index 76600f7f1..5b503cc14 100644 --- a/app/controllers/smtp_config_controller.rb +++ b/app/controllers/smtp_config_controller.rb @@ -84,9 +84,9 @@ def params_to_settings(params) address: params['address'], port: params['port'], enable_starttls_auto: params['enable_starttls_auto'] == 'true', - authentication: params['authentication'], - user_name: params['username'], - password: params['password'] + authentication: params['authentication'] == 'none' ? nil : params['authentication'], + user_name: params['username'] == "" ? nil : params['username'], + password: params['password'] == "" ? nil : params['password'] } if params.key?(:domain) && !params[:domain].empty? diff --git a/app/views/admins/_smtp_integration.html.erb b/app/views/admins/_smtp_integration.html.erb index 2f45b1cdf..5db9504b5 100644 --- a/app/views/admins/_smtp_integration.html.erb +++ b/app/views/admins/_smtp_integration.html.erb @@ -54,7 +54,7 @@ Specify mail server password if necessary