public void ProviderShouldBeOverridenWhenSpfandDkimFailAndOnBlocklist(DmarcResult spfResult, DmarcResult dkimResult, int blocklistCount, string expectedProvider)
        {
            AggregateReportRecordEnriched aggregateReportRecordEnriched = CreateTestRecord(spfResult, dkimResult, blockListCount: blocklistCount);
            var result = aggregateReportRecordEnriched.ToDomainDateProviderRecord();

            Assert.AreEqual(expectedProvider, result[0].Provider);
        }
 private AggregateReportRecord CreateSource(DmarcResult dkimResult = DmarcResult.pass, DmarcResult spfResult = DmarcResult.pass)
 {
     return(new AggregateReportRecord("", "", "", DateTime.MinValue, "",
                                      Alignment.r, Alignment.r, Policy.none, Policy.none, 0, "", "", 0, Policy.none,
                                      dkimResult, spfResult, "", "", "", new List <string> {
         ""
     }, 0, 0, new List <string>()
     {
         ""
     }, 0, 0, false, false,
                                      false, false, false, false, false));
 }
예제 #3
0
        private static DomainDateProviderSubdomainRecord CreateDomainDateProvider(DmarcResult spfResult, DmarcResult dkimResult,
                                                                                  Policy disposition, long recordId, string domain, DateTime date, string provider, string subdomain, int count)
        {
            if (spfResult == DmarcResult.pass && dkimResult == DmarcResult.pass && disposition == Policy.none)
            {
                return(new DomainDateProviderSubdomainRecord(recordId, domain, date, provider, subdomain, count, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
            }

            if (spfResult == DmarcResult.pass && dkimResult == DmarcResult.fail && disposition == Policy.none)
            {
                return(new DomainDateProviderSubdomainRecord(recordId, domain, date, provider, subdomain, 0, count, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
            }

            if (spfResult == DmarcResult.fail && dkimResult == DmarcResult.pass && disposition == Policy.none)
            {
                return(new DomainDateProviderSubdomainRecord(recordId, domain, date, provider, subdomain, 0, 0, count, 0, 0, 0, 0, 0, 0, 0, 0, 0));
            }

            if (spfResult == DmarcResult.fail && dkimResult == DmarcResult.fail && disposition == Policy.none)
            {
                return(new DomainDateProviderSubdomainRecord(recordId, domain, date, provider, subdomain, 0, 0, 0, count, 0, 0, 0, 0, 0, 0, 0, 0));
            }

            if (spfResult == DmarcResult.pass && dkimResult == DmarcResult.pass && disposition == Policy.quarantine)
            {
                return(new DomainDateProviderSubdomainRecord(recordId, domain, date, provider, subdomain, 0, 0, 0, 0, count, 0, 0, 0, 0, 0, 0, 0));
            }

            if (spfResult == DmarcResult.pass && dkimResult == DmarcResult.fail && disposition == Policy.quarantine)
            {
                return(new DomainDateProviderSubdomainRecord(recordId, domain, date, provider, subdomain, 0, 0, 0, 0, 0, count, 0, 0, 0, 0, 0, 0));
            }

            if (spfResult == DmarcResult.fail && dkimResult == DmarcResult.pass && disposition == Policy.quarantine)
            {
                return(new DomainDateProviderSubdomainRecord(recordId, domain, date, provider, subdomain, 0, 0, 0, 0, 0, 0, count, 0, 0, 0, 0, 0));
            }

            if (spfResult == DmarcResult.fail && dkimResult == DmarcResult.fail && disposition == Policy.quarantine)
            {
                return(new DomainDateProviderSubdomainRecord(recordId, domain, date, provider, subdomain, 0, 0, 0, 0, 0, 0, 0, count, 0, 0, 0, 0));
            }

            if (spfResult == DmarcResult.pass && dkimResult == DmarcResult.pass && disposition == Policy.reject)
            {
                return(new DomainDateProviderSubdomainRecord(recordId, domain, date, provider, subdomain, 0, 0, 0, 0, 0, 0, 0, 0, count, 0, 0, 0));
            }

            if (spfResult == DmarcResult.pass && dkimResult == DmarcResult.fail && disposition == Policy.reject)
            {
                return(new DomainDateProviderSubdomainRecord(recordId, domain, date, provider, subdomain, 0, 0, 0, 0, 0, 0, 0, 0, 0, count, 0, 0));
            }

            if (spfResult == DmarcResult.fail && dkimResult == DmarcResult.pass && disposition == Policy.reject)
            {
                return(new DomainDateProviderSubdomainRecord(recordId, domain, date, provider, subdomain, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, count, 0));
            }

            return(new DomainDateProviderSubdomainRecord(recordId, domain, date, provider, subdomain, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, count));
        }