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
- <%= form.select :authentication, [:plain, :login, :cram_md5], selected: @smtp_config_hash.nil? ? "plain" : @smtp_config_hash[:authentication], required: true %> + <%= form.select :authentication, [:none, :plain, :login, :cram_md5], selected: @smtp_config_hash.nil? ? "plain" : @smtp_config_hash[:authentication], required: true %> <%= form.label :authentication, "Mail Server authentication method" %> Specify mail Server authentication method
diff --git a/docs/installation/mailing.md b/docs/installation/mailing.md index 5d2f51d4c..93545b3aa 100644 --- a/docs/installation/mailing.md +++ b/docs/installation/mailing.md @@ -61,7 +61,7 @@ To set Autolab up to use a custom SMTP Server, you will need to make edits to th address: 'smtp.example.com', port: 25, enable_starttls_auto: true, - authentication: 'plain', # Other options include: 'login', 'cram_md5' + authentication: 'plain', # Other options include: 'login', 'cram_md5', 'none' user_name: 'example', password: 'example', domain: 'example.com',