private void OnCategorizedMessageHandler(CategorizedMessageEventSource source,
                                          QueuedMessageEventArgs e)
 {
     Logger.Debug("[GenericTransportAgent] RoutingAgent - OnCategorizedMessage fired...");
     _config.RoutingAgentConfig.OnCategorizedMessage.ToList().ForEach(
         x => { try { x.Execute(new EmailItem(e.MailItem)); } catch (Exception ex) { Logger.Error(ex, @"Error Executing ""OnCategorizedMessage"""); } });
 }
Esempio n. 2
0
 private void WhenMessageCategorized(CategorizedMessageEventSource source, QueuedMessageEventArgs e)
 {
     try
     {
         this.SignMailItem(e.MailItem);
     }
     catch (Exception ex)
     {
         Logger.LogError(Resources.DkimSigningRoutingAgent_SignFailed + "\n" + ex.ToString());
     }
 }
 private void WhenMessageCategorized(CategorizedMessageEventSource source, QueuedMessageEventArgs e)
 {
     try
     {
         this.SignMailItem(e.MailItem);
     }
     catch (Exception ex)
     {
         Logger.LogError("Signing a mail item according to DKIM failed with an exception. Check the logged exception for details.\n" + ex.ToString());
     }
 }
        private void WhenMessageCategorized(CategorizedMessageEventSource source, QueuedMessageEventArgs e)
        {
            Logger.LogDebug("Got new message, checking if I can sign it...");

            // get the async context. For an example see: http://www.getcodesamples.com/src/D062E1E9/2552BA7
            // The agent uses the agentAsyncContext object when the agent uses asynchronous execution.
            // The AgentAsyncContext.Complete() method must be invoked
            // before the server will continue processing a message
            agentAsyncContext = GetAgentAsyncContext();

            ThreadPool.QueueUserWorkItem(new WaitCallback(HandleMessageEvent), e.MailItem);
        }
        private void OnCategorizedMessageHandler(CategorizedMessageEventSource source,
                                                 QueuedMessageEventArgs e)
        {
            Logger.Debug("[GenericExchangeTransportagent] [RoutingAgent] OnCategorizedMessage fired...");
            var emailItem = new EmailItem(e.MailItem);
            _config.RoutingAgentConfig.OnCategorizedMessage.ToList().ForEach(
                x => { try { x.Execute(emailItem); } catch (Exception ex) { Logger.Error(ex, @"Error Executing ""OnCategorizedMessage"""); } });

            if (emailItem.ShouldBeDeletedFromQueue)
            {
                source.Delete();
            }
        }
        private void WhenMessageCategorized(CategorizedMessageEventSource source, QueuedMessageEventArgs e)
        {
            Logger.LogDebug("Got new message, checking if I can sign it...");

            // get the async context. For an example see: http://www.getcodesamples.com/src/D062E1E9/2552BA7
            // The agent uses the agentAsyncContext object when the agent uses asynchronous execution.
            // The AgentAsyncContext.Complete() method must be invoked
            // before the server will continue processing a message
            agentAsyncContext = GetAgentAsyncContext();

            ThreadPool.QueueUserWorkItem(new WaitCallback(HandleMessageEvent), e.MailItem);

        }
Esempio n. 7
0
        private void OnCategorizedMessageHandler(CategorizedMessageEventSource source,
                                                 QueuedMessageEventArgs e)
        {
            Logger.Debug("[GenericExchangeTransportagent] [RoutingAgent] OnCategorizedMessage fired...");
            var emailItem = new EmailItem(e.MailItem);

            _config.RoutingAgentConfig.OnCategorizedMessage.ToList().ForEach(
                x => { try { x.Execute(emailItem); } catch (Exception ex) { Logger.Error(ex, @"Error Executing ""OnCategorizedMessage"""); } });

            if (emailItem.ShouldBeDeletedFromQueue)
            {
                source.Delete();
            }
        }
Esempio n. 8
0
        private void OnCategorizedMessageHandler(CategorizedMessageEventSource source, QueuedMessageEventArgs e)
        {
            Logger.Debug("[GenericTransportAgent] RoutingAgent - OnCategorizedMessage fired...");
            var emailItem = new EmailItem(e.MailItem);

            foreach (var x in Configuration.Config.RoutingAgentConfig.OnCategorizedMessage)
            {
                try
                {
                    x.Execute(emailItem);
                }
                catch (Exception ex)
                {
                    Logger.Error(ex, @"Error Executing ""OnCategorizedMessage""");
                }
            }

            if (emailItem.ShouldBeDeletedFromQueue)
            {
                source.Delete();
            }
        }
 private void WhenMessageCategorized(CategorizedMessageEventSource source, QueuedMessageEventArgs e)
 {
     try
     {
         this.SignMailItem(e.MailItem);
     }
     catch (Exception ex)
     {
         Logger.LogError(Resources.DkimSigningRoutingAgent_SignFailed + "\n" + ex.ToString());
     }
 }
 private void WhenMessageCategorized(CategorizedMessageEventSource source, QueuedMessageEventArgs e)
 {
     Logger.LogDebug("Got new message, checking if I can sign it...");
     try
     {
         this.agentAsyncContext = this.GetAgentAsyncContext();
     #if !EX_2007_SP3 //not supported in Exchange 2007
         this.agentAsyncContext.Resume();
     #endif
         this.SignMailItem(e.MailItem);
     }
     catch (Exception ex)
     {
         Logger.LogError("Signing a mail item according to DKIM failed with an exception. Check the logged exception for details.\n" + ex.ToString());
     }
     finally
     {
         this.agentAsyncContext.Complete();
     }
 }