From ae20f349448ea2da47b1b60d4755f2306ebe1bdd Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 4 Jan 2013 23:30:57 +0100 Subject: [PATCH] Fixed #37 - added port options. --- .../javascripts/app/controllers/_channel/email.js.coffee | 4 +++- app/models/channel/smtp.rb | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_channel/email.js.coffee b/app/assets/javascripts/app/controllers/_channel/email.js.coffee index 5724ff635..b49fbd9c2 100644 --- a/app/assets/javascripts/app/controllers/_channel/email.js.coffee +++ b/app/assets/javascripts/app/controllers/_channel/email.js.coffee @@ -490,7 +490,8 @@ class App.ChannelEmailOutbound extends App.Controller { name: 'host', display: 'Host', tag: 'input', type: 'text', limit: 120, null: false, class: 'span4', autocapitalize: false, default: (channel_used['options']&&channel_used['options']['host']) }, { name: 'user', display: 'User', tag: 'input', type: 'text', limit: 120, null: true, class: 'span4', autocapitalize: false, default: (channel_used['options']&&channel_used['options']['user']) }, { name: 'password', display: 'Password', tag: 'input', type: 'password', limit: 120, null: true, class: 'span4', autocapitalize: false, default: (channel_used['options']&&channel_used['options']['password']) }, - { name: 'ssl', display: 'SSL', tag: 'select', multiple: false, null: false, options: { true: 'yes', false: 'no' } , class: 'span4', default: (channel_used['options']&&channel_used['options']['ssl']) }, + { name: 'ssl', display: 'SSL', tag: 'select', multiple: false, null: false, options: { true: 'yes', false: 'no' } , class: 'span4', translate: true, default: (channel_used['options']&&channel_used['options']['ssl']) }, + { name: 'port', display: 'Port', tag: 'input', type: 'text', limit: 5, null: false, class: 'span1', autocapitalize: false, default: ((channel_used['options']&&channel_used['options']['port']) || 25) }, ] @form = new App.ControllerForm( el: @el.find('#form-email-adapter-settings'), @@ -525,6 +526,7 @@ class App.ChannelEmailOutbound extends App.Controller user: params['user'], password: params['password'], ssl: params['ssl'], + port: params['port'], }, active: true, ) diff --git a/app/models/channel/smtp.rb b/app/models/channel/smtp.rb index 56a12fe63..c446c3364 100644 --- a/app/models/channel/smtp.rb +++ b/app/models/channel/smtp.rb @@ -9,8 +9,7 @@ class Channel::SMTP < Channel::EmailBuild mail.delivery_method :smtp, { :openssl_verify_mode => 'none', :address => channel[:options][:host], - # :port => 587, - :port => 25, + :port => channel[:options][:port] || 25, :domain => channel[:options][:host], :user_name => channel[:options][:user], :password => channel[:options][:password],