aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/MainModule.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-07-26 17:12:51 -0700
committerAnton Tananaev <anton@traccar.org>2022-07-26 17:12:51 -0700
commit8f129e2a70abbea66f33213c84b7e63f9e96035a (patch)
tree1acf2d3736fb3800e4b9f325b436f22c7f9ea3b3 /src/main/java/org/traccar/MainModule.java
parentf5033ce11b823a4fce080211368b8c6473d81e7b (diff)
downloadtrackermap-server-8f129e2a70abbea66f33213c84b7e63f9e96035a.tar.gz
trackermap-server-8f129e2a70abbea66f33213c84b7e63f9e96035a.tar.bz2
trackermap-server-8f129e2a70abbea66f33213c84b7e63f9e96035a.zip
Testing mail manager
Diffstat (limited to 'src/main/java/org/traccar/MainModule.java')
-rw-r--r--src/main/java/org/traccar/MainModule.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/MainModule.java b/src/main/java/org/traccar/MainModule.java
index b9543af25..b8ff21472 100644
--- a/src/main/java/org/traccar/MainModule.java
+++ b/src/main/java/org/traccar/MainModule.java
@@ -63,6 +63,9 @@ import org.traccar.handler.GeocoderHandler;
import org.traccar.handler.GeolocationHandler;
import org.traccar.handler.SpeedLimitHandler;
import org.traccar.helper.SanitizerModule;
+import org.traccar.mail.LogMailManager;
+import org.traccar.mail.MailManager;
+import org.traccar.mail.SmtpMailManager;
import org.traccar.notification.EventForwarder;
import org.traccar.session.cache.CacheManager;
import org.traccar.sms.HttpSmsClient;
@@ -128,6 +131,15 @@ public class MainModule extends AbstractModule {
return null;
}
+ @Provides
+ public static MailManager provideMailManager(Config config, StatisticsManager statisticsManager) {
+ if (config.getBoolean(Keys.MAIL_DEBUG)) {
+ return new LogMailManager();
+ } else {
+ return new SmtpMailManager(config, statisticsManager);
+ }
+ }
+
@Singleton
@Provides
public static LdapProvider provideLdapProvider(Config config) {