diff options
author | Berke Viktor <github.bviktor@outlook.com> | 2014-05-08 21:13:12 +0200 |
---|---|---|
committer | Berke Viktor <github.bviktor@outlook.com> | 2014-05-08 21:13:12 +0200 |
commit | 07ddbb3a490ef40426c234c75bce91a851ced975 (patch) | |
tree | 287438f1c5a44ac3bd882586fb56221d080046ac /src/main/java/com/gitblit/service | |
parent | 1d2d5efe6d5dafbd2236776bc4667521921e5c8c (diff) | |
download | gitblit-07ddbb3a490ef40426c234c75bce91a851ced975.tar.gz gitblit-07ddbb3a490ef40426c234c75bce91a851ced975.zip |
Add option to explicitly specify the use of STARTTLS
Required for servers that use STARTTLS without SMTPS such as Office 365
Diffstat (limited to 'src/main/java/com/gitblit/service')
-rw-r--r-- | src/main/java/com/gitblit/service/MailService.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/service/MailService.java b/src/main/java/com/gitblit/service/MailService.java index 4759d177..ae9727fc 100644 --- a/src/main/java/com/gitblit/service/MailService.java +++ b/src/main/java/com/gitblit/service/MailService.java @@ -68,6 +68,7 @@ public class MailService implements Runnable { final String mailUser = settings.getString(Keys.mail.username, null);
final String mailPassword = settings.getString(Keys.mail.password, null);
final boolean smtps = settings.getBoolean(Keys.mail.smtps, false);
+ final boolean starttls = settings.getBoolean(Keys.mail.starttls, false);
boolean authenticate = !StringUtils.isEmpty(mailUser) && !StringUtils.isEmpty(mailPassword);
String server = settings.getString(Keys.mail.server, "");
if (StringUtils.isEmpty(server)) {
@@ -86,6 +87,7 @@ public class MailService implements Runnable { props.setProperty("mail.smtp.port", String.valueOf(port));
props.setProperty("mail.smtp.auth", String.valueOf(authenticate));
props.setProperty("mail.smtp.auths", String.valueOf(authenticate));
+ props.setProperty("mail.smtp.starttls.enable", String.valueOf(starttls));
if (isGMail || smtps) {
props.setProperty("mail.smtp.starttls.enable", "true");
|