Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow SMTP auth to be nil #2210

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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