diff options
Diffstat (limited to 'src/org/traccar/notification')
-rw-r--r-- | src/org/traccar/notification/NotificationMail.java | 2 | ||||
-rw-r--r-- | src/org/traccar/notification/PropertiesProvider.java | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/org/traccar/notification/NotificationMail.java b/src/org/traccar/notification/NotificationMail.java index d7f3bf64c..fc70a6115 100644 --- a/src/org/traccar/notification/NotificationMail.java +++ b/src/org/traccar/notification/NotificationMail.java @@ -43,7 +43,7 @@ public final class NotificationMail { if (host != null) { properties.put("mail.transport.protocol", provider.getString("mail.transport.protocol", "smtp")); properties.put("mail.smtp.host", host); - properties.put("mail.smtp.port", provider.getString("mail.smtp.port", "25")); + properties.put("mail.smtp.port", String.valueOf(provider.getInteger("mail.smtp.port", 25))); String starttlsEnable = provider.getString("mail.smtp.starttls.enable"); if (starttlsEnable != null) { diff --git a/src/org/traccar/notification/PropertiesProvider.java b/src/org/traccar/notification/PropertiesProvider.java index 2fea901af..1a4104d2b 100644 --- a/src/org/traccar/notification/PropertiesProvider.java +++ b/src/org/traccar/notification/PropertiesProvider.java @@ -48,4 +48,14 @@ public class PropertiesProvider { return value; } + public int getInteger(String key, int defaultValue) { + if (config != null) { + return config.getInteger(key, defaultValue); + } else if (extendedModel.getAttributes().containsKey(key)) { + return Integer.parseInt(extendedModel.getAttributes().get(key).toString()); + } else { + return defaultValue; + } + } + } |