Skip to content
This repository has been archived by the owner on Jul 5, 2020. It is now read-only.

Commit

Permalink
Merge pull request #39 from Temelio/fix_mailer_plugin
Browse files Browse the repository at this point in the history
Fix missing suffix and bad port management for mailer plugin
  • Loading branch information
achaussier committed Mar 17, 2016
2 parents 28c2907 + 15bb322 commit e6770ee
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions files/groovy_scripts/manage_jenkins_plugin_mailer.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ def Boolean set_mailer_plugin_smtp_host(Descriptor desc,
@return Boolean True if changed, else false
*/
def Boolean set_mailer_plugin_smtp_port(Descriptor desc,
Integer new_smtp_port) {
String new_smtp_port) {

// Get current value, used to check if changed
def Integer cur_smtp_port = desc.getSmtpPort()
def String cur_smtp_port = desc.getSmtpPort()

if (cur_smtp_port == null || cur_smtp_port == new_smtp_port) {
if (cur_smtp_port == new_smtp_port) {
return false
}

Expand Down Expand Up @@ -278,7 +278,7 @@ def String new_default_suffix = ""
def String new_reply_to = ""
def String new_smtp_host = ""
def String new_smtp_password = ""
def Integer new_smtp_port = 25
def String new_smtp_port = '25'
def String new_smtp_user = ""
def Boolean new_use_ssl = false

Expand All @@ -296,13 +296,15 @@ try {
new_reply_to = data['reply_to']
new_smtp_host = data['smtp_host']
new_smtp_password = data['smtp_password']
new_smtp_port = data['smtp_port']
new_smtp_port = data['smtp_port'].toString()
new_smtp_user = data['smtp_user']
new_use_ssl = data['use_ssl']

// Manage configuration with user data
has_changed.push(set_mailer_plugin_smtp_auth(desc, new_smtp_user,
new_smtp_password))
has_changed.push(set_mailer_plugin_default_suffix(desc,
new_default_suffix))
has_changed.push(set_mailer_plugin_smtp_host(desc, new_smtp_host))
has_changed.push(set_mailer_plugin_smtp_port(desc, new_smtp_port))
has_changed.push(set_mailer_plugin_reply_to(desc, new_reply_to))
Expand Down

0 comments on commit e6770ee

Please sign in to comment.