From 41d643b82998eb87c393529e5934acdbe72664f0 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 21 Jan 2022 14:06:26 -0500 Subject: [PATCH] Check the Headers for MessageId before assigning a value in MimeMessage .ctor Fixes issue #747 --- MimeKit/MimeMessage.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MimeKit/MimeMessage.cs b/MimeKit/MimeMessage.cs index fec75fb4bb..b3fad4b4ae 100644 --- a/MimeKit/MimeMessage.cs +++ b/MimeKit/MimeMessage.cs @@ -226,7 +226,7 @@ public MimeMessage (params object[] args) : this (ParserOptions.Default.Clone () Date = DateTimeOffset.Now; if (!Headers.Contains (HeaderId.Subject)) Subject = string.Empty; - if (messageId == null) + if (!Headers.Contains (HeaderId.MessageId)) MessageId = MimeUtils.GenerateMessageId (); }