12 | {
13 | [SetUp]
14 | public void TestFixtureSetUp()
15 | {
16 | Name = "DisclaimerHandler";
17 | }
18 |
19 | [Test]
20 | public void DisclaimerHandlerHtmlTest()
21 | {
22 | const string value = "DisclaimerHandlerHtmlTest Value
";
23 | const string wrappedValue = "" + value + "";
24 |
25 | var emailMessage = EmailMessage.Create(BodyFormat.Html);
26 | emailMessage.From = new EmailRecipient("Alice", "alice@neos-it.de");
27 | emailMessage.To.Add(new EmailRecipient("Bob", "bob@neos-it.de"));
28 | emailMessage.SetBody("DisclaimerHandlerHtmlTest SubjectDisclaimerHandlerHtmlTest Body");
29 | emailMessage.Subject = "DisclaimerHandlerHtmlTest Subject";
30 |
31 | TestObject.Html = wrappedValue;
32 |
33 | PrepareLogger();
34 |
35 | TestObject.Execute(new EmailItem(emailMessage));
36 |
37 | string body = emailMessage.GetBody();
38 |
39 | Assert.IsTrue(body.Contains(value));
40 | }
41 |
42 | [Test]
43 | [Ignore("Warum zur Hölle wird keine EmailMessage mit BodyFormat.Rtf unterstützt???")]
44 | public void DisclaimerHandlerRtfTest()
45 | {
46 | const string value = "DisclaimerHandlerRtfTest Value";
47 |
48 | var emailMessage = EmailMessage.Create(BodyFormat.Rtf);
49 | emailMessage.From = new EmailRecipient("Alice", "alice@neos-it.de");
50 | emailMessage.To.Add(new EmailRecipient("Bob", "bob@neos-it.de"));
51 | emailMessage.SetBody("DisclaimerHandlerRtfTest Body");
52 | emailMessage.Subject = "DisclaimerHandlerRtfTest Subject";
53 |
54 | TestObject.Rtf = value;
55 |
56 | PrepareLogger();
57 |
58 | TestObject.Execute(new EmailItem(emailMessage));
59 |
60 | string body = emailMessage.GetBody();
61 |
62 | Assert.IsTrue(body.Contains(value));
63 | }
64 |
65 | [Test]
66 | public void DisclaimerHandlerTextTest()
67 | {
68 | const string value = "DisclaimerHandlerTextTest Value";
69 |
70 | var emailMessage = EmailMessage.Create(BodyFormat.Text);
71 | emailMessage.From = new EmailRecipient("Alice", "alice@neos-it.de");
72 | emailMessage.To.Add(new EmailRecipient("Bob", "bob@neos-it.de"));
73 | emailMessage.SetBody("DisclaimerHandlerHtmlTest Body");
74 | emailMessage.Subject = "DisclaimerHandlerHtmlTest Subject";
75 |
76 | TestObject.Text = value;
77 |
78 | PrepareLogger();
79 |
80 | TestObject.Execute(new EmailItem(emailMessage));
81 |
82 | string body = emailMessage.GetBody();
83 |
84 | Assert.IsTrue(body.Contains(value));
85 | }
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/Geta.GuiApplication/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace NeosIT.Exchange.GenericExchangeTransportAgent.GuiApplication.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NeosIT.Exchange.GenericExchangeTransportAgent.GuiApplication.Properties.Resources" +
43 | "", typeof(Resources).Assembly);
44 | resourceMan = temp;
45 | }
46 | return resourceMan;
47 | }
48 | }
49 |
50 | ///
51 | /// Overrides the current thread's CurrentUICulture property for all
52 | /// resource lookups using this strongly typed resource class.
53 | ///
54 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
55 | internal static global::System.Globalization.CultureInfo Culture {
56 | get {
57 | return resourceCulture;
58 | }
59 | set {
60 | resourceCulture = value;
61 | }
62 | }
63 |
64 | ///
65 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
66 | ///
67 | internal static System.Drawing.Icon Icon {
68 | get {
69 | object obj = ResourceManager.GetObject("Icon", resourceCulture);
70 | return ((System.Drawing.Icon)(obj));
71 | }
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/Geta.Tests/ConfigTests.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Linq;
3 | using System.Threading.Tasks;
4 | using NeosIT.Exchange.GenericExchangeTransportAgent.Impl.Config;
5 | using NeosIT.Exchange.GenericExchangeTransportAgent.Plugins.MailEndpointHandler.Impl;
6 | using NUnit.Framework;
7 |
8 | namespace NeosIT.Exchange.GenericExchangeTransportAgent.Tests
9 | {
10 | ///
11 | /// In these test we have to delay the tests because the filesystem watcher is not instant. We wait for ~1s every
12 | /// time we rely on the filesystem watcher.
13 | ///
14 | [TestFixture]
15 | public class ConfigTests
16 | {
17 | private string _configFileContents;
18 |
19 | [SetUp]
20 | public void Setup()
21 | {
22 | _configFileContents = File.ReadAllText(Configuration.FullPath);
23 | }
24 |
25 | [TearDown]
26 | public async Task Teardown()
27 | {
28 | Configuration.HotReloadEnabled = true;
29 | // relies on the file watcher to reload / reset the config.
30 | File.WriteAllText(Configuration.FullPath, _configFileContents);
31 | await Task.Delay(1000);
32 | }
33 |
34 | [Test]
35 | public async Task TestHotReload()
36 | {
37 | var config = Configuration.Config;
38 |
39 | Assert.IsEmpty(config.RoutingAgentConfig.OnRoutedMessage);
40 |
41 | File.WriteAllText(Configuration.FullPath, @"
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | ");
50 |
51 | await Task.Delay(1000); // wait for filesystem watcher to catch up
52 |
53 | var config2 = Configuration.Config;
54 |
55 | Assert.AreSame(config, config2);
56 |
57 | Assert.IsNotEmpty(config.RoutingAgentConfig.OnRoutedMessage);
58 | Assert.IsInstanceOf(config.RoutingAgentConfig.OnRoutedMessage.First());
59 | }
60 |
61 | [Test]
62 | public async Task TestHotReloadSwitch()
63 | {
64 | Configuration.HotReloadEnabled = false;
65 |
66 | var config = Configuration.Config;
67 |
68 | Assert.IsEmpty(config.RoutingAgentConfig.OnRoutedMessage);
69 |
70 | File.WriteAllText(Configuration.FullPath, "");
71 |
72 | await Task.Delay(1000); // be sure to wait. When the watcher is still enabled it may not be fast enough.
73 |
74 | Assert.IsEmpty(config.RoutingAgentConfig.OnRoutedMessage);
75 | }
76 |
77 | [Test]
78 | public async Task TestHotReloadIsFailSafe()
79 | {
80 | var config = Configuration.Config;
81 |
82 | File.WriteAllText(Configuration.FullPath, @"
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 | ");
91 |
92 | await Task.Delay(1000); // wait for filesystem watcher to catch up
93 |
94 | Assert.IsNotEmpty(config.RoutingAgentConfig.OnRoutedMessage);
95 |
96 | File.WriteAllText(Configuration.FullPath, @"");
97 |
98 | await Task.Delay(1000); // wait for filesystem watcher to catch up
99 |
100 | Assert.IsNotEmpty(config.RoutingAgentConfig.OnRoutedMessage);
101 | }
102 | }
103 | }
--------------------------------------------------------------------------------
/Geta.Plugins.DisclaimerHandler/Geta.Plugins.DisclaimerHandler.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2016 RTM
5 | AnyCPU
6 | ../libs
7 | {0B8B0A99-CD43-46CD-BF2C-A317441E1F24}
8 | Library
9 | Properties
10 | NeosIT.Exchange.GenericExchangeTransportAgent.Plugins.DisclaimerHandler
11 | Geta.Plugins.DisclaimerHandler
12 | 512
13 | v4.7.2
14 |
15 |
16 | v3.5
17 | bin\2010\
18 | EXCHANGE_2010;NET35
19 |
20 |
21 | bin\2016 RTM\
22 | EXCHANGE_2016_RTM
23 |
24 |
25 |
26 | $(ExchangeLibrariesPath)\Exchange 2010\Microsoft.Exchange.Data.Transport.dll
27 |
28 |
29 | ..\libs\System.ComponentModel.Composition.dll
30 |
31 |
32 |
33 |
34 | $(ExchangeLibrariesPath)\Exchange 2016 RTM\Microsoft.Exchange.Data.Transport.dll
35 |
36 |
37 |
38 |
39 |
40 | ..\packages\HtmlAgilityPack.1.4.6\lib\Net20\HtmlAgilityPack.dll
41 |
42 |
43 | ..\packages\Ninject.3.0.1.10\lib\net35\Ninject.dll
44 |
45 |
46 | ..\packages\Ninject.Extensions.Logging.3.0.1.0\lib\net35\Ninject.Extensions.Logging.dll
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | {BBEA07C8-5924-4A67-8A03-9E6459A66E68}
67 | NeosIT.Exchange.GenericExchangeTransportAgent
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/Geta.Setup/Setup.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Geta.Setup {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Setup {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Setup() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Geta.Setup.Setup", typeof(Setup).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized string similar to Lorem Ipsum.
65 | ///
66 | internal static string AppDescription {
67 | get {
68 | return ResourceManager.GetString("AppDescription", resourceCulture);
69 | }
70 | }
71 |
72 | ///
73 | /// Looks up a localized string similar to A 64 bit operation system is required.
74 | ///
75 | internal static string ErrorPlatform64Required {
76 | get {
77 | return ResourceManager.GetString("ErrorPlatform64Required", resourceCulture);
78 | }
79 | }
80 |
81 | ///
82 | /// Looks up a localized string similar to Windows 7 or Server 2008 R2 or higher is required..
83 | ///
84 | internal static string ErrorVersionTooLow {
85 | get {
86 | return ResourceManager.GetString("ErrorVersionTooLow", resourceCulture);
87 | }
88 | }
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/Geta.Plugins.NoopHandler/Geta.Plugins.NoopHandler.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2016 RTM
5 | AnyCPU
6 | ../libs
7 | {96949535-995A-4536-ADBA-F2D60D54B8D6}
8 | Library
9 | Properties
10 | NeosIT.Exchange.GenericExchangeTransportAgent.Plugins.NoopHandler
11 | Geta.Plugins.NoopHandler
12 | 512
13 | v4.7.2
14 |
15 |
16 | v3.5
17 | bin\2010\
18 | EXCHANGE_2010;NET35
19 |
20 |
21 | bin\2016 RTM\
22 | EXCHANGE_2016_RTM
23 |
24 |
25 |
26 | $(ExchangeLibrariesPath)\Exchange 2010\Microsoft.Exchange.Data.Common.dll
27 |
28 |
29 | $(ExchangeLibrariesPath)\Exchange 2010\Microsoft.Exchange.Data.Transport.dll
30 |
31 |
32 | ..\libs\System.ComponentModel.Composition.dll
33 |
34 |
35 |
36 |
37 | $(ExchangeLibrariesPath)\Exchange 2016 RTM\Microsoft.Exchange.Data.Common.dll
38 |
39 |
40 | $(ExchangeLibrariesPath)\Exchange 2016 RTM\Microsoft.Exchange.Data.Transport.dll
41 |
42 |
43 |
44 |
45 |
46 | ..\packages\Ninject.3.0.1.10\lib\net35\Ninject.dll
47 |
48 |
49 | ..\packages\Ninject.Extensions.Logging.3.0.1.0\lib\net35\Ninject.Extensions.Logging.dll
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 | {BBEA07C8-5924-4A67-8A03-9E6459A66E68}
69 | NeosIT.Exchange.GenericExchangeTransportAgent
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/Geta.Plugins.ExecutableHandler/Geta.Plugins.ExecutableHandler.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2016 RTM
5 | AnyCPU
6 | ../libs
7 | {3395CD93-59E3-453A-8806-49F4DEF9E3B8}
8 | Library
9 | Properties
10 | NeosIT.Exchange.GenericExchangeTransportAgent.Plugins.ExecutableHandler
11 | Geta.Plugins.ExecutableHandler
12 | 512
13 | v4.7.2
14 |
15 |
16 | v3.5
17 | bin\2010\
18 | EXCHANGE_2010;NET35
19 |
20 |
21 | bin\2016 RTM\
22 | EXCHANGE_2016_RTM
23 |
24 |
25 |
26 | $(ExchangeLibrariesPath)\Exchange 2010\Microsoft.Exchange.Data.Common.dll
27 |
28 |
29 | $(ExchangeLibrariesPath)\Exchange 2010\Microsoft.Exchange.Data.Transport.dll
30 |
31 |
32 | ..\libs\System.ComponentModel.Composition.dll
33 |
34 |
35 |
36 |
37 | $(ExchangeLibrariesPath)\Exchange 2016 RTM\Microsoft.Exchange.Data.Common.dll
38 |
39 |
40 | $(ExchangeLibrariesPath)\Exchange 2016 RTM\Microsoft.Exchange.Data.Transport.dll
41 |
42 |
43 |
44 |
45 |
46 | ..\packages\Ninject.3.0.1.10\lib\net35\Ninject.dll
47 |
48 |
49 | ..\packages\Ninject.Extensions.Logging.3.0.1.0\lib\net35\Ninject.Extensions.Logging.dll
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 | {BBEA07C8-5924-4A67-8A03-9E6459A66E68}
69 | NeosIT.Exchange.GenericExchangeTransportAgent
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/Geta.GuiApplication/Plugins/ExtractAttachmentConfigForm.designer.cs:
--------------------------------------------------------------------------------
1 | namespace NeosIT.Exchange.GenericExchangeTransportAgent.GuiApplication.Plugins
2 | {
3 | partial class ExtractAttachmentConfigForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExtractAttachmentConfigForm));
32 | this.SettingsDataGridView = new System.Windows.Forms.DataGridView();
33 | this.SaveDialogButton = new System.Windows.Forms.Button();
34 | this.CancelDialogButton = new System.Windows.Forms.Button();
35 | this.SettingsLabel = new System.Windows.Forms.Label();
36 | ((System.ComponentModel.ISupportInitialize)(this.SettingsDataGridView)).BeginInit();
37 | this.SuspendLayout();
38 | //
39 | // SettingsDataGridView
40 | //
41 | this.SettingsDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
42 | resources.ApplyResources(this.SettingsDataGridView, "SettingsDataGridView");
43 | this.SettingsDataGridView.Name = "SettingsDataGridView";
44 | //
45 | // SaveDialogButton
46 | //
47 | resources.ApplyResources(this.SaveDialogButton, "SaveDialogButton");
48 | this.SaveDialogButton.Name = "SaveDialogButton";
49 | this.SaveDialogButton.UseVisualStyleBackColor = true;
50 | this.SaveDialogButton.Click += new System.EventHandler(this.SaveButtonClick);
51 | //
52 | // CancelDialogButton
53 | //
54 | resources.ApplyResources(this.CancelDialogButton, "CancelDialogButton");
55 | this.CancelDialogButton.Name = "CancelDialogButton";
56 | this.CancelDialogButton.UseVisualStyleBackColor = true;
57 | this.CancelDialogButton.Click += new System.EventHandler(this.CancelDialogButtonClick);
58 | //
59 | // SettingsLabel
60 | //
61 | resources.ApplyResources(this.SettingsLabel, "SettingsLabel");
62 | this.SettingsLabel.Name = "SettingsLabel";
63 | //
64 | // ExtractAttachmentConfigForm
65 | //
66 | resources.ApplyResources(this, "$this");
67 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
68 | this.Controls.Add(this.SettingsLabel);
69 | this.Controls.Add(this.CancelDialogButton);
70 | this.Controls.Add(this.SaveDialogButton);
71 | this.Controls.Add(this.SettingsDataGridView);
72 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
73 | this.Name = "ExtractAttachmentConfigForm";
74 | this.Load += new System.EventHandler(this.ConfigFormLoad);
75 | ((System.ComponentModel.ISupportInitialize)(this.SettingsDataGridView)).EndInit();
76 | this.ResumeLayout(false);
77 | this.PerformLayout();
78 |
79 | }
80 |
81 | #endregion
82 |
83 | private System.Windows.Forms.DataGridView SettingsDataGridView;
84 | private System.Windows.Forms.Button SaveDialogButton;
85 | private System.Windows.Forms.Button CancelDialogButton;
86 | private System.Windows.Forms.Label SettingsLabel;
87 | }
88 | }
--------------------------------------------------------------------------------
/Geta.Plugins.ExtractAttachmentHandler/Geta.Plugins.ExtractAttachmentHandler.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2016 RTM
5 | AnyCPU
6 | ../libs
7 | {085E66F6-6806-456E-A33C-5ED32D636EE6}
8 | Library
9 | Properties
10 | NeosIT.Exchange.GenericExchangeTransportAgent.Plugins.ExtractAttachmentHandler
11 | Geta.Plugins.ExtractAttachmentHandler
12 | 512
13 | v4.7.2
14 |
15 |
16 | v3.5
17 | bin\2010\
18 | EXCHANGE_2010;NET35
19 |
20 |
21 | bin\2016 RTM\
22 | EXCHANGE_2016_RTM
23 |
24 |
25 |
26 | $(ExchangeLibrariesPath)\Exchange 2010\Microsoft.Exchange.Data.Common.dll
27 |
28 |
29 | $(ExchangeLibrariesPath)\Exchange 2010\Microsoft.Exchange.Data.Transport.dll
30 |
31 |
32 | ..\libs\System.ComponentModel.Composition.dll
33 |
34 |
35 |
36 |
37 | $(ExchangeLibrariesPath)\Exchange 2016 RTM\Microsoft.Exchange.Data.Transport.dll
38 |
39 |
40 | $(ExchangeLibrariesPath)\Exchange 2016 RTM\Microsoft.Exchange.Net.dll
41 |
42 |
43 | $(ExchangeLibrariesPath)\Exchange 2016 RTM\Microsoft.Exchange.Common.IL.dll
44 |
45 |
46 |
47 |
48 |
49 | ..\packages\Ninject.3.0.1.10\lib\net35\Ninject.dll
50 |
51 |
52 | ..\packages\Ninject.Extensions.Logging.3.0.1.0\lib\net35\Ninject.Extensions.Logging.dll
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | {BBEA07C8-5924-4A67-8A03-9E6459A66E68}
72 | NeosIT.Exchange.GenericExchangeTransportAgent
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/Geta/Impl/Agents/GenericRoutingAgent.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.Exchange.Data.Transport.Routing;
3 | using NeosIT.Exchange.GenericExchangeTransportAgent.Impl.Config;
4 | using Ninject;
5 | using Ninject.Extensions.Logging;
6 |
7 | namespace NeosIT.Exchange.GenericExchangeTransportAgent.Impl.Agents
8 | {
9 | public class GenericRoutingAgent : RoutingAgent
10 | {
11 | public IKernel Kernel { get; internal set; }
12 | public ILogger Logger { get; internal set; }
13 |
14 | public GenericRoutingAgent()
15 | {
16 | Kernel = NInjectHelper.GetKernel();
17 | Logger = Kernel.Get().GetCurrentClassLogger();
18 |
19 | OnCategorizedMessage += OnCategorizedMessageHandler;
20 | OnResolvedMessage += OnResolvedMessageHandler;
21 | OnRoutedMessage += OnRoutedMessageHandler;
22 | OnSubmittedMessage += OnSubmittedMessageHandler;
23 | }
24 |
25 | private void OnCategorizedMessageHandler(CategorizedMessageEventSource source, QueuedMessageEventArgs e)
26 | {
27 | Logger.Debug("[GenericTransportAgent] RoutingAgent - OnCategorizedMessage fired...");
28 | var emailItem = new EmailItem(e.MailItem);
29 | foreach(var x in Configuration.Config.RoutingAgentConfig.OnCategorizedMessage)
30 | {
31 | try
32 | {
33 | x.Execute(emailItem);
34 | }
35 | catch (Exception ex)
36 | {
37 | Logger.Error(ex, @"Error Executing ""OnCategorizedMessage""");
38 | }
39 | }
40 |
41 | if (emailItem.ShouldBeDeletedFromQueue)
42 | {
43 | source.Delete();
44 | }
45 | }
46 |
47 | private void OnResolvedMessageHandler(ResolvedMessageEventSource source, QueuedMessageEventArgs e)
48 | {
49 | Logger.Debug("[GenericTransportAgent] RoutingAgent - OnResolvedMessage fired...");
50 | var emailItem = new EmailItem(e.MailItem);
51 | foreach (var x in Configuration.Config.RoutingAgentConfig.OnResolvedMessage)
52 | {
53 | try
54 | {
55 | x.Execute(emailItem);
56 | }
57 | catch (Exception ex)
58 | {
59 | Logger.Error(ex, @"Error Executing ""OnResolvedMessage""");
60 | }
61 | }
62 |
63 | if (emailItem.ShouldBeDeletedFromQueue)
64 | {
65 | source.Delete();
66 | }
67 | }
68 |
69 | private void OnRoutedMessageHandler(RoutedMessageEventSource source, QueuedMessageEventArgs e)
70 | {
71 | Logger.Debug("[GenericTransportAgent] RoutingAgent - OnRoutedMessage fired...");
72 | var emailItem = new EmailItem(e.MailItem);
73 | foreach (var x in Configuration.Config.RoutingAgentConfig.OnRoutedMessage)
74 | {
75 | try
76 | {
77 | x.Execute(emailItem);
78 | }
79 | catch (Exception ex)
80 | {
81 | Logger.Error(ex, @"Error Executing ""OnRoutedMessage""");
82 | }
83 | }
84 |
85 | if (emailItem.ShouldBeDeletedFromQueue)
86 | {
87 | source.Delete();
88 | }
89 | }
90 |
91 | private void OnSubmittedMessageHandler(SubmittedMessageEventSource source, QueuedMessageEventArgs e)
92 | {
93 | Logger.Debug("[GenericTransportAgent] RoutingAgent - OnSubmittedMessage fired...");
94 | var emailItem = new EmailItem(e.MailItem);
95 | foreach (var x in Configuration.Config.RoutingAgentConfig.OnSubmittedMessage)
96 | {
97 | try
98 | {
99 | x.Execute(emailItem);
100 | }
101 | catch (Exception ex)
102 | {
103 | Logger.Error(ex, @"Error Executing ""OnSubmittedMessage""");
104 | }
105 | }
106 |
107 | if (emailItem.ShouldBeDeletedFromQueue)
108 | {
109 | source.Delete();
110 | }
111 | }
112 | }
113 | }
--------------------------------------------------------------------------------
/Geta.Plugins.TwitterNotificationHandler/Geta.Plugins.TwitterNotificationHandler.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2016 RTM
5 | AnyCPU
6 | ../libs
7 | {A5486C2F-19D1-4C91-B0AD-7E3BFAE2D259}
8 | Library
9 | Properties
10 | NeosIT.Exchange.GenericExchangeTransportAgent.Plugins.TwitterNotificationHandler
11 | Geta.Plugins.TwitterNotificationHandler
12 | 512
13 | v4.7.2
14 |
15 |
16 | v3.5
17 | bin\2010\
18 | EXCHANGE_2010;NET35
19 |
20 |
21 | bin\2016 RTM\
22 | EXCHANGE_2016_RTM
23 |
24 |
25 |
26 | $(ExchangeLibrariesPath)\Exchange 2010\Microsoft.Exchange.Data.Common.dll
27 |
28 |
29 | $(ExchangeLibrariesPath)\Exchange 2010\Microsoft.Exchange.Data.Transport.dll
30 |
31 |
32 | ..\libs\System.ComponentModel.Composition.dll
33 |
34 |
35 |
36 |
37 | $(ExchangeLibrariesPath)\Exchange 2016 RTM\Microsoft.Exchange.Data.Common.dll
38 |
39 |
40 | $(ExchangeLibrariesPath)\Exchange 2016 RTM\Microsoft.Exchange.Data.Transport.dll
41 |
42 |
43 |
44 |
45 |
46 | ..\libs\Newtonsoft.Json.dll
47 |
48 |
49 | ..\libs\Twitterizer2.dll
50 |
51 |
52 | ..\packages\Ninject.3.0.2-unstable-9037\lib\net35\Ninject.dll
53 |
54 |
55 | ..\packages\Ninject.Extensions.Logging.3.0.1.0\lib\net35\Ninject.Extensions.Logging.dll
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 | {BBEA07C8-5924-4A67-8A03-9E6459A66E68}
76 | NeosIT.Exchange.GenericExchangeTransportAgent
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------