more email rule stuff

This commit is contained in:
Norm MacLennan
2014-05-07 10:25:48 -07:00
parent 77e91fe423
commit 25f19ff86a
5 changed files with 45 additions and 2 deletions

View File

@@ -60,6 +60,7 @@
<Compile Include="Plugins\Email\EmailSettings.cs" />
<Compile Include="Imports\IDataImportHook.cs" />
<Compile Include="Imports\DataImports.cs" />
<Compile Include="Plugins\Email\ParseRule.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>

View File

@@ -11,6 +11,7 @@ namespace NOCQ.Plugins.Email
public string Folder {get;set;}
public bool IsSsl {get;set;}
public int Frequency { get; set; }
public IEnumerable<ParseRule> ParseRules {get;set;}
}
}

View File

@@ -14,7 +14,7 @@ namespace NOCQ.Plugins.Email
private int port { get; set; }
private bool ssl { get; set; }
private DateTime lastRun { get; set; }
private IEnumerable<ParseRule> parseRules{ get; set; }
public ImapInput (dynamic settings)
{
@@ -29,6 +29,8 @@ namespace NOCQ.Plugins.Email
|| sets.IsSsl == null)
throw new ArgumentException ("You are missing a required setting.");
parseRules = sets.ParseRules.Where (x => x.Enabled);
loginName = settings.Login;
password = settings.Password;
server = settings.Server;

View File

@@ -0,0 +1,18 @@
using System;
namespace NOCQ.Plugins.Email
{
public class ParseRule
{
public string Name { get; set; }
public bool Enabled { get; set; }
public string From {get;set;}
public string Source {get;set;}
public string System {get;set;}
public string Service {get;set;}
public string Data {get;set;}
public string Runbook { get; set;}
public string Severity {get;set;}
}
}