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 | |
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
-rw-r--r-- | src/main/distrib/data/gitblit.properties | 5 | ||||
-rw-r--r-- | src/main/java/com/gitblit/service/MailService.java | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/main/distrib/data/gitblit.properties b/src/main/distrib/data/gitblit.properties index 3215094e..fd30b6d7 100644 --- a/src/main/distrib/data/gitblit.properties +++ b/src/main/distrib/data/gitblit.properties @@ -1410,6 +1410,11 @@ mail.debug = false # use SMTPs flag
mail.smtps = false
+# use STARTTLS flag
+#
+# SINCE 1.6.0
+mail.starttls = false
+
# if your smtp server requires authentication, supply the credentials here
#
# SINCE 0.6.0
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");
|