diff --git a/src/NOCQ/Extensability/Catalog.cs b/src/NOCQ/Extensability/Catalog.cs
index f58656e..dbbcecb 100644
--- a/src/NOCQ/Extensability/Catalog.cs
+++ b/src/NOCQ/Extensability/Catalog.cs
@@ -12,7 +12,6 @@ namespace NOCQ
public Catalog()
{
Container.ComposeParts(this);
-
}
}
}
diff --git a/src/NOCQ/ImapInput.cs b/src/NOCQ/ImapInput.cs
deleted file mode 100644
index 85595e7..0000000
--- a/src/NOCQ/ImapInput.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using System;
-
-namespace NOCQ
-{
- public class ImapInput
- {
- private string loginName { get; set; }
- private string password { get; set; }
- private string server { get; set; }
- private string folderPath { get; set; }
-
- public ImapInput (dynamic settings)
- {
- if (settings.Login == null
- || settings.Password == null
- || settings.Server == null
- || settings.FolderPath == null)
- throw new ArgumentException ("You are missing a required setting.");
-
- loginName = settings.Login;
- password = settings.Password;
- server = settings.Server;
- folderPath = settings.FolderPath;
- }
-
- public void Run()
- {
-
- }
-
- public void Stop()
- {
-
- }
- }
-}
-
diff --git a/src/NOCQ/NOCQ.csproj b/src/NOCQ/NOCQ.csproj
index 0d37b52..483a717 100644
--- a/src/NOCQ/NOCQ.csproj
+++ b/src/NOCQ/NOCQ.csproj
@@ -54,9 +54,10 @@
-
+
+
@@ -65,5 +66,7 @@
+
+
diff --git a/src/NOCQ/Plugins/Email/EmailSettings.cs b/src/NOCQ/Plugins/Email/EmailSettings.cs
new file mode 100644
index 0000000..5fdedac
--- /dev/null
+++ b/src/NOCQ/Plugins/Email/EmailSettings.cs
@@ -0,0 +1,16 @@
+using System;
+
+namespace NOCQ.Plugins.Email
+{
+ public class EmailSettings
+ {
+ public string Username {get;set;}
+ public string Password {get;set;}
+ public string Host {get;set;}
+ public int Port {get;set;}
+ public string Folder {get;set;}
+ public bool IsSsl {get;set;}
+ public int Frequency { get; set; }
+ }
+}
+
diff --git a/src/NOCQ/Plugins/Email/ImapInput.cs b/src/NOCQ/Plugins/Email/ImapInput.cs
new file mode 100644
index 0000000..afb40f6
--- /dev/null
+++ b/src/NOCQ/Plugins/Email/ImapInput.cs
@@ -0,0 +1,72 @@
+using System;
+using System.Timers;
+using AE.Net.Mail;
+
+namespace NOCQ.Plugins.Email
+{
+ public class ImapInput
+ {
+ private string loginName { get; set; }
+ private string password { get; set; }
+ private string server { get; set; }
+ private string folderPath { get; set; }
+ private Timer timer { get; set; }
+ private int port { get; set; }
+ private bool ssl { get; set; }
+ private DateTime lastRun { get; set; }
+
+
+ public ImapInput (dynamic settings)
+ {
+ var sets = settings as EmailSettings;
+
+ if (sets.Username == null
+ || sets.Password == null
+ || sets.Host == null
+ || sets.Folder == null
+ || sets.Frequency == null
+ || sets.Port == null
+ || sets.IsSsl == null)
+ throw new ArgumentException ("You are missing a required setting.");
+
+ loginName = settings.Login;
+ password = settings.Password;
+ server = settings.Server;
+ folderPath = settings.FolderPath;
+
+ timer = new Timer (settings.Frequency);
+
+ timer.Elapsed += Execute ();
+ }
+
+
+ public void Execute()
+ {
+ using(var imap = new ImapClient(server, loginName, password, ImapClient.AuthMethods.Login, port, ssl)) {
+ var msgs = imap.SearchMessages(
+ SearchCondition.Undeleted().And(
+ SearchCondition.SentSince(new DateTime(2000, 1, 1))
+ ));
+
+ foreach (var msg in msgs)
+ {
+ var realMsg = msg.Value;
+
+ var from = realMsg.From;
+ var body = realMsg.Body;
+
+ }
+ }
+ }
+
+ public void Run()
+ {
+ timer.Start ();
+ }
+
+ public void Stop()
+ {
+ timer.Stop ();
+ }
+ }
+}
\ No newline at end of file