Exemple #1
0
        internal static string GetMessageIdHash(this HeaderList headerCollection)
        {
            var messageIdHeaderEntry = headerCollection["Message-ID"];

            if (string.IsNullOrEmpty(messageIdHeaderEntry))
            {
                messageIdHeaderEntry = headerCollection.ToHMSGID();
                return(messageIdHeaderEntry);
            }

            var threadIndex = headerCollection["Thread-Index"];

            if (threadIndex is not null)
            {
                messageIdHeaderEntry = $"{threadIndex}|{messageIdHeaderEntry}";

                if (messageIdHeaderEntry.Length > 255)
                {
                    messageIdHeaderEntry = headerCollection.ToHMSGID();
                }
            }

            messageIdHeaderEntry = messageIdHeaderEntry.ToNMSGID();

            return(messageIdHeaderEntry);
        }
Exemple #2
0
        internal static string GetMessageId(this HeaderList headerCollection)
        {
            var messageIdHeaderEntry = headerCollection["Message-ID"];

            if (string.IsNullOrEmpty(messageIdHeaderEntry))
            {
                messageIdHeaderEntry = headerCollection.ToHMSGID();
                return(messageIdHeaderEntry);
            }

            return(messageIdHeaderEntry);
        }