aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/notification/NotificationMail.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-08-03 10:33:01 +0500
committerAbyss777 <abyss@fox5.ru>2016-08-03 10:33:01 +0500
commitf7d58f2a13b23b36d861faa95e66a96fb4bd1dbb (patch)
treea45fd475abdadae3636d2771e1afdae7b4fdfea2 /src/org/traccar/notification/NotificationMail.java
parente177e7d083a4dd3f64172802661bf658d26d1163 (diff)
downloadtrackermap-server-f7d58f2a13b23b36d861faa95e66a96fb4bd1dbb.tar.gz
trackermap-server-f7d58f2a13b23b36d861faa95e66a96fb4bd1dbb.tar.bz2
trackermap-server-f7d58f2a13b23b36d861faa95e66a96fb4bd1dbb.zip
- Optimized SSL connection
- Added "mail.smtp.ssl.trust" parameter
Diffstat (limited to 'src/org/traccar/notification/NotificationMail.java')
-rw-r--r--src/org/traccar/notification/NotificationMail.java19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/org/traccar/notification/NotificationMail.java b/src/org/traccar/notification/NotificationMail.java
index 944200f2f..bc7f6d4da 100644
--- a/src/org/traccar/notification/NotificationMail.java
+++ b/src/org/traccar/notification/NotificationMail.java
@@ -48,14 +48,11 @@ public final class NotificationMail {
result.put("mail.smtp.port", config.getString("mail.smtp.port", "25"));
if (config.getBoolean("mail.smtp.starttls.enable")) {
- result.put("mail.smtp.starttls.enable",
- config.getBoolean("mail.smtp.starttls.enable"));
+ result.put("mail.smtp.starttls.enable", config.getBoolean("mail.smtp.starttls.enable"));
} else if (config.getBoolean("mail.smtp.ssl.enable")) {
- result.put("mail.smtp.socketFactory.port",
- result.getProperty("mail.smtp.port"));
- result.put("mail.smtp.socketFactory.class",
- "javax.net.ssl.SSLSocketFactory");
+ result.put("mail.smtp.ssl.enable", config.getBoolean("mail.smtp.ssl.enable"));
}
+ result.put("mail.smtp.ssl.trust", config.getBoolean("mail.smtp.ssl.trust"));
result.put("mail.smtp.auth", config.getBoolean("mail.smtp.auth"));
result.put("mail.smtp.user", config.getString("mail.smtp.username", null));
@@ -77,12 +74,10 @@ public final class NotificationMail {
result.put("mail.smtp.starttls.enable", tls);
} else if (object.getAttributes().containsKey("mail.smtp.ssl.enable")) {
boolean ssl = Boolean.parseBoolean((String) object.getAttributes().get("mail.smtp.ssl.enable"));
- if (ssl) {
- result.put("mail.smtp.socketFactory.port",
- result.getProperty("mail.smtp.port"));
- result.put("mail.smtp.socketFactory.class",
- "javax.net.ssl.SSLSocketFactory");
- }
+ result.put("mail.smtp.ssl.enable", ssl);
+ }
+ if (object.getAttributes().containsKey("mail.smtp.ssl.trust")) {
+ result.put("mail.smtp.ssl.trust", object.getAttributes().get("mail.smtp.ssl.trust"));
}
boolean auth = Boolean.parseBoolean((String) object.getAttributes().get("mail.smtp.auth"));
result.put("mail.smtp.auth", auth);