예제 #1
0
 public static void BuildRegionList(DataRow inputRow, DataTable dataTable, DataObjectStore store)
 {
     dataTable.BeginLoadData();
     Array.ForEach <string>(HygieneUtils.iso3166Alpha2Codes, delegate(string code)
     {
         string text = code.ToUpper().ToString();
         string regionDisplayName = Antispam.GetRegionDisplayName(text);
         DataRow dataRow          = dataTable.NewRow();
         dataRow["RegionCode"]    = text;
         dataRow["RegionName"]    = regionDisplayName;
         dataRow["Identity"]      = new Identity(text, regionDisplayName);
         dataTable.Rows.Add(dataRow);
     });
     dataTable.EndLoadData();
 }
예제 #2
0
        public static void GetContentFilterPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            if (dataTable.Rows.Count == 0)
            {
                return;
            }
            DataRow row = dataTable.Rows[0];

            Antispam.contentEmailListParameters.ForEach(delegate(string p)
            {
                if (!row[p].IsNullValue())
                {
                    MultiValuedProperty <SmtpAddress> multiValuedProperty = (MultiValuedProperty <SmtpAddress>)row[p];
                    row[string.Format("str{0}", p)] = multiValuedProperty.ToStringArray <SmtpAddress>().StringArrayJoin("; ");
                }
            });
            List <Identity> list         = new List <Identity>();
            List <Identity> list2        = new List <Identity>();
            LanguageList    languageList = new LanguageList();

            if (!row["RegionBlockList"].IsNullValue())
            {
                foreach (string text in ((MultiValuedProperty <string>)row["RegionBlockList"]))
                {
                    list.Add(new Identity(text.ToString(), Antispam.GetRegionDisplayName(text)));
                }
                row["regionList"] = list.ToArray();
            }
            if (!row["LanguageBlockList"].IsNullValue())
            {
                foreach (string text2 in ((MultiValuedProperty <string>)row["LanguageBlockList"]))
                {
                    list2.Add(new Identity(text2.ToString(), RtlUtil.ConvertToDecodedBidiString(languageList.GetDisplayValue(text2), RtlUtil.IsRtl)));
                }
                row["languageList"] = list2.ToArray();
            }
        }
예제 #3
0
        public static void GetContentFilterSDOPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            if (dataTable.Rows.Count == 0)
            {
                return;
            }
            DataRow row = dataTable.Rows[0];

            Antispam.contentEmailListParameters.ForEach(delegate(string p)
            {
                if (!row[p].IsNullValue())
                {
                    MultiValuedProperty <SmtpAddress> multiValuedProperty3 = (MultiValuedProperty <SmtpAddress>)row[p];
                    row[string.Format("str{0}", p)] = multiValuedProperty3.ToStringArray <SmtpAddress>().StringArrayJoin("; ");
                }
            });
            row["FalsePositiveStatus"] = ((!string.IsNullOrEmpty(row["strFalsePositiveAdditionalRecipients"].ToString())) ? Strings.ASConfigured.ToString() : Strings.ASNotConfigured.ToString());
            MultiValuedProperty <string> multiValuedProperty = new MultiValuedProperty <string>();

            if (Antispam.ParsedASFEIsOn(row["IncreaseScoreWithImageLinks"].ToString()))
            {
                multiValuedProperty.Add(Strings.IncreaseScoreWithImageLinksSDO);
            }
            if (Antispam.ParsedASFEIsOn(row["IncreaseScoreWithNumericIps"].ToString()))
            {
                multiValuedProperty.Add(Strings.IncreaseScoreWithNumericIPsSDO);
            }
            if (Antispam.ParsedASFEIsOn(row["IncreaseScoreWithRedirectToOtherPort"].ToString()))
            {
                multiValuedProperty.Add(Strings.IncreaseScoreWithRedirectToOtherPortSDO);
            }
            if (Antispam.ParsedASFEIsOn(row["IncreaseScoreWithBizOrInfoUrls"].ToString()))
            {
                multiValuedProperty.Add(Strings.IncreaseScoreWithBizContentFilteringSDO);
            }
            if (Antispam.ParsedASFEIsOn(row["MarkAsSpamEmptyMessages"].ToString()))
            {
                multiValuedProperty.Add(Strings.MarkAsSpamEmptyMessagesSDO);
            }
            if (Antispam.ParsedASFEIsOn(row["MarkAsSpamJavaScriptInHtml"].ToString()))
            {
                multiValuedProperty.Add(Strings.MarkAsSpamJavaScriptInHtmlSDO);
            }
            if (Antispam.ParsedASFEIsOn(row["MarkAsSpamFramesInHtml"].ToString()))
            {
                multiValuedProperty.Add(Strings.MarkAsSpamFramesInhtmlSDO);
            }
            if (Antispam.ParsedASFEIsOn(row["MarkAsSpamObjectTagsInHtml"].ToString()))
            {
                multiValuedProperty.Add(Strings.MarkAsSpamObjectTagsInHtmlSDO);
            }
            if (Antispam.ParsedASFEIsOn(row["MarkAsSpamEmbedTagsInHtml"].ToString()))
            {
                multiValuedProperty.Add(Strings.MarkAsSpamEmbedTagsInHtmlSDO);
            }
            if (Antispam.ParsedASFEIsOn(row["MarkAsSpamFormTagsInHtml"].ToString()))
            {
                multiValuedProperty.Add(Strings.MarkAsSpamFormTagsInHtmlSDO);
            }
            if (Antispam.ParsedASFEIsOn(row["MarkAsSpamWebBugsInHtml"].ToString()))
            {
                multiValuedProperty.Add(Strings.MarkAsSpamWebBugsInHtmlSDO);
            }
            if (Antispam.ParsedASFEIsOn(row["MarkAsSpamSensitiveWordList"].ToString()))
            {
                multiValuedProperty.Add(Strings.MarkAsSpamSensitiveWordListSDO);
            }
            if (Antispam.ParsedASFEIsOn(row["MarkAsSpamSpfRecordHardFail"].ToString()))
            {
                multiValuedProperty.Add(Strings.MarkAsSpamSpfRecordHardFailSDO);
            }
            if (Antispam.ParsedASFEIsOn(row["MarkAsSpamFromAddressAuthFail"].ToString()))
            {
                multiValuedProperty.Add(Strings.MarkAsSpamFromAddressAuthFailSDO);
            }
            if (Antispam.ParsedASFEIsOn(row["MarkAsSpamNdrBackscatter"].ToString()))
            {
                multiValuedProperty.Add(Strings.MarkAsSpamNdrBackscatterSDO);
            }
            if (Antispam.ParsedASFEIsOn(row["MarkAsSpamBulkMail"].ToString()))
            {
                multiValuedProperty.Add(Strings.MarkAsSpamBulkMailSDO);
            }
            if (multiValuedProperty.Count == 0)
            {
                multiValuedProperty.Add(Strings.ASNone);
            }
            row["ASFOnOutput"] = multiValuedProperty;
            MultiValuedProperty <string> multiValuedProperty2 = new MultiValuedProperty <string>();

            if (Antispam.ParsedASFEIsTest(row["IncreaseScoreWithImageLinks"].ToString()))
            {
                multiValuedProperty2.Add(Strings.IncreaseScoreWithImageLinksSDO);
            }
            if (Antispam.ParsedASFEIsTest(row["IncreaseScoreWithNumericIps"].ToString()))
            {
                multiValuedProperty2.Add(Strings.IncreaseScoreWithNumericIPsSDO);
            }
            if (Antispam.ParsedASFEIsTest(row["IncreaseScoreWithRedirectToOtherPort"].ToString()))
            {
                multiValuedProperty2.Add(Strings.IncreaseScoreWithRedirectToOtherPortSDO);
            }
            if (Antispam.ParsedASFEIsTest(row["IncreaseScoreWithBizOrInfoUrls"].ToString()))
            {
                multiValuedProperty2.Add(Strings.IncreaseScoreWithBizContentFilteringSDO);
            }
            if (Antispam.ParsedASFEIsTest(row["MarkAsSpamEmptyMessages"].ToString()))
            {
                multiValuedProperty2.Add(Strings.MarkAsSpamEmptyMessagesSDO);
            }
            if (Antispam.ParsedASFEIsTest(row["MarkAsSpamJavaScriptInHtml"].ToString()))
            {
                multiValuedProperty2.Add(Strings.MarkAsSpamJavaScriptInHtmlSDO);
            }
            if (Antispam.ParsedASFEIsTest(row["MarkAsSpamFramesInHtml"].ToString()))
            {
                multiValuedProperty2.Add(Strings.MarkAsSpamFramesInhtmlSDO);
            }
            if (Antispam.ParsedASFEIsTest(row["MarkAsSpamObjectTagsInHtml"].ToString()))
            {
                multiValuedProperty2.Add(Strings.MarkAsSpamObjectTagsInHtmlSDO);
            }
            if (Antispam.ParsedASFEIsTest(row["MarkAsSpamEmbedTagsInHtml"].ToString()))
            {
                multiValuedProperty2.Add(Strings.MarkAsSpamEmbedTagsInHtmlSDO);
            }
            if (Antispam.ParsedASFEIsTest(row["MarkAsSpamFormTagsInHtml"].ToString()))
            {
                multiValuedProperty2.Add(Strings.MarkAsSpamFormTagsInHtmlSDO);
            }
            if (Antispam.ParsedASFEIsTest(row["MarkAsSpamWebBugsInHtml"].ToString()))
            {
                multiValuedProperty2.Add(Strings.MarkAsSpamWebBugsInHtmlSDO);
            }
            if (Antispam.ParsedASFEIsTest(row["MarkAsSpamSensitiveWordList"].ToString()))
            {
                multiValuedProperty2.Add(Strings.MarkAsSpamSensitiveWordListSDO);
            }
            if (Antispam.ParsedASFEIsTest(row["MarkAsSpamSpfRecordHardFail"].ToString()))
            {
                multiValuedProperty2.Add(Strings.MarkAsSpamSpfRecordHardFailSDO);
            }
            if (Antispam.ParsedASFEIsTest(row["MarkAsSpamFromAddressAuthFail"].ToString()))
            {
                multiValuedProperty2.Add(Strings.MarkAsSpamFromAddressAuthFailSDO);
            }
            if (Antispam.ParsedASFEIsTest(row["MarkAsSpamNdrBackscatter"].ToString()))
            {
                multiValuedProperty2.Add(Strings.MarkAsSpamNdrBackscatterSDO);
            }
            if (Antispam.ParsedASFEIsTest(row["MarkAsSpamBulkMail"].ToString()))
            {
                multiValuedProperty2.Add(Strings.MarkAsSpamBulkMailSDO);
            }
            if (multiValuedProperty2.Count == 0)
            {
                multiValuedProperty2.Add(Strings.ASNone);
            }
            row["ASFTestOutput"] = multiValuedProperty2;
            string value = string.Empty;

            switch ((SpamFilteringTestModeAction)Enum.Parse(typeof(SpamFilteringTestModeAction), row["TestModeAction"].ToString(), true))
            {
            case SpamFilteringTestModeAction.None:
                value = Strings.ASNone;
                break;

            case SpamFilteringTestModeAction.AddXHeader:
                value = Strings.AddTestXHeaderSDOLabel;
                break;

            case SpamFilteringTestModeAction.BccMessage:
                value = Strings.BccMessageSDOLabel;
                break;
            }
            row["TestModeDisplay"] = value;
        }