Skip to content

Commit

Permalink
Cleanup smtp code
Browse files Browse the repository at this point in the history
  • Loading branch information
olblak committed Jun 7, 2017
1 parent 4fafa8a commit 1522f7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/main/java/org/jenkinsci/account/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,8 @@ public void delete(DirContext con) throws NamingException {
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);
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/jenkinsci/account/Parameters.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.jenkinsci.account;

import com.sun.org.apache.xpath.internal.operations.Bool;

import java.util.Date;

/**
Expand All @@ -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();
Expand Down

0 comments on commit 1522f7d

Please sign in to comment.