Skip to content

Commit

Permalink
Allow SMTP auth to be nil (#2210)
Browse files Browse the repository at this point in the history
  • Loading branch information
KesterTan authored Oct 20, 2024
1 parent 9324880 commit 12c5047
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/controllers/smtp_config_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
2 changes: 1 addition & 1 deletion app/views/admins/_smtp_integration.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<span class="helper-text">Specify mail server password if necessary</span>
</div>
<div class="input-field">
<%= 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" %>
<span class="helper-text">Specify mail Server authentication method</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/installation/mailing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 12c5047

Please sign in to comment.