|
@@ -12,6 +12,7 @@ using InABox.Core;
|
|
|
using InABox.Database;
|
|
|
using InABox.Database.SQLite;
|
|
|
using InABox.IPC;
|
|
|
+using InABox.Mail;
|
|
|
using InABox.Rpc;
|
|
|
using InABox.Server;
|
|
|
using InABox.Wpf.Reports;
|
|
@@ -139,6 +140,38 @@ public class DatabaseEngine : Engine<DatabaseServerProperties>
|
|
|
x => x.Closed
|
|
|
)).Rows.Select(x => x.ToObject<Notification>());
|
|
|
}
|
|
|
+
|
|
|
+ private void ConfigureMailer()
|
|
|
+ {
|
|
|
+ if (!Properties.EmailProperties.IsNullOrWhiteSpace())
|
|
|
+ {
|
|
|
+ switch (Properties.GetEmailProperties())
|
|
|
+ {
|
|
|
+ case ServerEmailIMAPProperties imap:
|
|
|
+ DbFactory.Mailer = new IMAPMailer
|
|
|
+ {
|
|
|
+ SMTPHost = imap.Host,
|
|
|
+ SMTPDomain = imap.Domain,
|
|
|
+ SMTPUserName = imap.UserName,
|
|
|
+ SMTPPassword = imap.Password,
|
|
|
+ SMTPPort = imap.Port
|
|
|
+ };
|
|
|
+ DbFactory.EmailAddress = imap.EmailAddress;
|
|
|
+ break;
|
|
|
+ case ServerEmailExchangeProperties exchange:
|
|
|
+ DbFactory.Mailer = new ExchangeMailer
|
|
|
+ {
|
|
|
+ MailboxHost = exchange.Host,
|
|
|
+ MailboxDomain = exchange.Domain,
|
|
|
+ MailboxUserName = exchange.UserName,
|
|
|
+ MailboxPassword = exchange.Password,
|
|
|
+ MailboxPort = exchange.Port
|
|
|
+ };
|
|
|
+ DbFactory.EmailAddress = exchange.EmailAddress;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
#region Run/Stop Functionality
|
|
|
|