aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/MainModule.java
diff options
context:
space:
mode:
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) {