// Token: 0x0600150B RID: 5387 RVA: 0x0004ACA8 File Offset: 0x00048EA8
 internal static void TrackMatchingRecipientsAndAttachments(RuleEvaluationResult ruleEvaluationResult, PolicyTipRequestLogger policyTipRequestLogger, out EmailAddressWrapper[] recipientEmails, out string[] attachmentIds)
 {
     recipientEmails = null;
     attachmentIds   = null;
     if (ruleEvaluationResult == null)
     {
         return;
     }
     if (ruleEvaluationResult.Predicates != null)
     {
         List <string>             listA = null;
         PredicateEvaluationResult predicateEvaluationResult = RuleEvaluationResult.GetPredicateEvaluationResult(typeof(SentToPredicate), ruleEvaluationResult.Predicates).FirstOrDefault <PredicateEvaluationResult>();
         if (predicateEvaluationResult != null)
         {
             listA = predicateEvaluationResult.MatchResults;
         }
         List <string>             listB = null;
         PredicateEvaluationResult predicateEvaluationResult2 = RuleEvaluationResult.GetPredicateEvaluationResult(typeof(SentToScopePredicate), ruleEvaluationResult.Predicates).FirstOrDefault <PredicateEvaluationResult>();
         if (predicateEvaluationResult2 != null)
         {
             listB = predicateEvaluationResult2.MatchResults;
         }
         List <string>             locationList = null;
         PredicateEvaluationResult predicateEvaluationResult3 = (from mcdc in RuleEvaluationResult.GetPredicateEvaluationResult(typeof(ContainsDataClassificationPredicate), ruleEvaluationResult.Predicates)
                                                                 where mcdc.SupplementalInfo == 1
                                                                 select mcdc).FirstOrDefault <PredicateEvaluationResult>();
         if (predicateEvaluationResult3 != null)
         {
             locationList = predicateEvaluationResult3.MatchResults;
         }
         recipientEmails = OwaRulesEvaluationContext.IntersectAndReturnEmailAddressWrappers(listA, listB);
         attachmentIds   = OwaRulesEvaluationContext.GetAttachmentTypeIds(locationList, policyTipRequestLogger);
     }
 }
 // Token: 0x060014D0 RID: 5328 RVA: 0x00049EBC File Offset: 0x000480BC
 protected override object GetConditionValue(BaseTransportRulesEvaluationContext context)
 {
     if (!this.areAdressesExpanded)
     {
         OwaRulesEvaluationContext owaRulesEvaluationContext = context as OwaRulesEvaluationContext;
         this.SetValue(ADUtils.GetAllEmailAddresses(base.Value.RawValues, owaRulesEvaluationContext.OrganizationId));
         this.areAdressesExpanded = true;
     }
     return(base.Value.GetValue(context));
 }
        protected override ExecutionControl ExitRule()
        {
            OwaRulesEvaluationContext owaRulesEvaluationContext = (OwaRulesEvaluationContext)base.Context;

            if (owaRulesEvaluationContext.RuleExecutionMonitor != null)
            {
                owaRulesEvaluationContext.RuleExecutionMonitor.Stop(true);
            }
            ((OwaRulesEvaluationContext)base.Context).CapturePerRuleData();
            return(base.ExitRule());
        }
        protected override ExecutionControl EnterRule()
        {
            OwaRulesEvaluationContext owaRulesEvaluationContext = (OwaRulesEvaluationContext)base.Context;
            PolicyTipRule             policyTipRule             = (PolicyTipRule)owaRulesEvaluationContext.CurrentRule;

            if (owaRulesEvaluationContext.RuleExecutionMonitor != null)
            {
                owaRulesEvaluationContext.RuleExecutionMonitor.RuleId = policyTipRule.ImmutableId.ToString("D");
                owaRulesEvaluationContext.RuleExecutionMonitor.Restart();
            }
            owaRulesEvaluationContext.ResetPerRuleData();
            return(base.EnterRule());
        }
        // Token: 0x06001509 RID: 5385 RVA: 0x0004AAF8 File Offset: 0x00048CF8
        internal void CapturePerRuleMatchData()
        {
            DlpPolicyMatchDetail dlpPolicyMatchDetail = new DlpPolicyMatchDetail();

            dlpPolicyMatchDetail.Action = (DlpPolicyTipAction)Enum.Parse(typeof(DlpPolicyTipAction), base.ActionName);
            if (base.MatchedClassifications != null)
            {
                dlpPolicyMatchDetail.Classifications = new string[base.MatchedClassifications.Count];
                int num = 0;
                foreach (string key in base.MatchedClassifications.Keys)
                {
                    dlpPolicyMatchDetail.Classifications[num++] = base.MatchedClassifications[key];
                }
            }
            EmailAddressWrapper[] recipients = null;
            string[] attachmentIds           = null;
            OwaRulesEvaluationContext.TrackMatchingRecipientsAndAttachments(base.RulesEvaluationHistory.GetCurrentRuleResult(this), this.policyTipRequestLogger, out recipients, out attachmentIds);
            dlpPolicyMatchDetail.Recipients    = recipients;
            dlpPolicyMatchDetail.AttachmentIds = OwaRulesEvaluationContext.ConvertAttachmentIdsToAttachmentIdTypes(attachmentIds, this.Item, this.policyTipRequestLogger);
            this.DlpPolicyMatchDetails.Add(dlpPolicyMatchDetail);
        }
Beispiel #6
0
        protected override object OnGetValue(RulesEvaluationContext baseContext)
        {
            OwaRulesEvaluationContext owaRulesEvaluationContext = (OwaRulesEvaluationContext)baseContext;
            object result = null;
            string name;

            if ((name = base.Name) != null)
            {
                if (!(name == "Message.From"))
                {
                    if (!(name == "Message.To"))
                    {
                        if (name == "Message.DataClassifications")
                        {
                            result = owaRulesEvaluationContext.DataClassifications;
                        }
                    }
                    else
                    {
                        ShortList <string> recipients = owaRulesEvaluationContext.Recipients;
                        if (recipients != null && recipients.Any <string>())
                        {
                            result = recipients;
                        }
                    }
                }
                else
                {
                    result = new ShortList <string>
                    {
                        owaRulesEvaluationContext.FromAddress
                    };
                }
            }
            return(result);
        }
 public OwaRulesEvaluator(OwaRulesEvaluationContext context) : base(context)
 {
 }
 // Token: 0x0600150E RID: 5390 RVA: 0x0004AEF0 File Offset: 0x000490F0
 internal static string RuleEvalResultToString(RuleEvaluationResult ruleEvalResult)
 {
     if (ruleEvalResult == null)
     {
         return(string.Empty);
     }
     return(string.Format("IsRuleMatch:{0}/Predicates:{1}/Actions:{2}.", ruleEvalResult.IsMatch ? "1" : "0", string.Join(";", from predicate in ruleEvalResult.Predicates
                                                                                                                         select OwaRulesEvaluationContext.PredicateEvalResultToString(predicate)), string.Join(";", ruleEvalResult.Actions)));
 }
        // Token: 0x06001508 RID: 5384 RVA: 0x0004AAAC File Offset: 0x00048CAC
        internal void CapturePerRuleData()
        {
            RuleEvaluationResult currentRuleResult = base.RulesEvaluationHistory.GetCurrentRuleResult(this);

            this.ruleEvalResult.Append(string.Format("RuleName:{0};Result:{1}.", base.CurrentRule.Name, (currentRuleResult == null) ? "null" : OwaRulesEvaluationContext.RuleEvalResultToString(currentRuleResult)));
        }