From 1522f7d0621b45bda5480c86cb8e42600726ffd5 Mon Sep 17 00:00:00 2001 From: olblak Date: Wed, 7 Jun 2017 09:12:16 +0200 Subject: [PATCH] Cleanup smtp code --- src/main/java/org/jenkinsci/account/Application.java | 3 +-- src/main/java/org/jenkinsci/account/Parameters.java | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/jenkinsci/account/Application.java b/src/main/java/org/jenkinsci/account/Application.java index 6bf9bb1..0d0e4fa 100644 --- a/src/main/java/org/jenkinsci/account/Application.java +++ b/src/main/java/org/jenkinsci/account/Application.java @@ -490,9 +490,8 @@ public class Application { private Session createJavaMailSession() { Session session; Properties props = new Properties(System.getProperties()); - System.out.printf(params.smtpAuth()); props.put("mail.smtp.host",params.smtpServer()); - if(params.smtpAuth().equals("true")) { + if(params.smtpAuth()) { props.put("mail.smtp.auth", params.smtpAuth()); props.put("mail.smtp.starttls.enable", true); props.put("mail.smtp.port", 587); diff --git a/src/main/java/org/jenkinsci/account/Parameters.java b/src/main/java/org/jenkinsci/account/Parameters.java index 3edb9fa..b22f3f3 100644 --- a/src/main/java/org/jenkinsci/account/Parameters.java +++ b/src/main/java/org/jenkinsci/account/Parameters.java @@ -1,5 +1,7 @@ package org.jenkinsci.account; +import com.sun.org.apache.xpath.internal.operations.Bool; + import java.util.Date; /** @@ -26,9 +28,9 @@ public interface Parameters { * smtpAuth: If true, attempt to authenticate the user using the AUTH command. * smtpPassword: SMTP password for SMTP server. */ + Boolean smtpAuth(); String smtpServer(); String smtpUser(); - String smtpAuth(); String smtpPassword(); String recaptchaPublicKey();