private JunkEmailCollection.ValidationProblem CheckValue(string value) { if (value == null) { return(JunkEmailCollection.ValidationProblem.Null); } if (value.Length == 0) { return(JunkEmailCollection.ValidationProblem.Empty); } if (value.Length > JunkEmailCollection.MaxEntrySize) { return(JunkEmailCollection.ValidationProblem.TooBig); } if (base.Count >= this.MaxNumberOfEntries) { return(JunkEmailCollection.ValidationProblem.TooManyEntries); } if (!JunkEmailCollection.IsValidFormat(value)) { return(JunkEmailCollection.ValidationProblem.FormatError); } foreach (string value2 in this) { if (value.Equals(value2, StringComparison.OrdinalIgnoreCase)) { return(JunkEmailCollection.ValidationProblem.Duplicate); } } if (this.invlidEntriesCollection != null && this.invlidEntriesCollection.Contains(value)) { return(JunkEmailCollection.ValidationProblem.EntryInInvalidEntriesList); } return(JunkEmailCollection.ValidationProblem.NoError); }
internal static JunkEmailCollection Create(JunkEmailRule junkRule, JunkEmailCollection.ListType listType) { return(JunkEmailCollection.Create(junkRule, listType, null)); }
private static bool IsValidFormat(string value) { return(SmtpAddress.IsValidSmtpAddress(value) || SmtpAddress.IsValidSmtpAddress(JunkEmailCollection.MakeSmtpAddressFromDomain(value))); }