private static bool ShouldConsiderMessage()

in Mail2Bug/Email/EWS/RecipientsMailboxManager.cs [37:56]


        private static bool ShouldConsiderMessage(IIncomingEmailMessage message, string[] recipients)
        {
            if (message == null)
            {
                return false;
            }

            // If no recipients were mentioned, it means process all incoming emails
            if (!recipients.Any())
            {
                return true;
            }

            // If the recipient is in either the To or CC lines, then this message should be considered
            return recipients.Any(recipient =>
                EmailAddressesMatch(message.ToAddresses, recipient) ||
                EmailAddressesMatch(message.ToNames, recipient) ||
                EmailAddressesMatch(message.CcAddresses, recipient) ||
                EmailAddressesMatch(message.CcNames, recipient));
        }