Folder Container class mismatch

When Message class of the item and container class of the folder does not match , it throws error while in earlier version it was allowed.

Hello @ritikruhela26,

Could you please let us know which Aspose.Email version you are using and provide a small code sample that reproduces the issue?

For some scenarios, this behavior is intentional and was introduced to align with Outlook behavior. However, we’d like to verify whether your case falls into that category or if there is a regression.

Aspose.Email version 26.5.0

             string msgClass = msgInfo.MessageClass ?? "";
         /////////////

         Console.WriteLine(
 $"{soucrce_folder.DisplayName} | " +
 $"{soucrce_folder.ContainerClass} | " +
 $"{msgInfo.MessageClass}");

         ///////////////////////

         if (msgClass.StartsWith("IPM.Configuration",
             StringComparison.OrdinalIgnoreCase))
         {
             continue;
         }

         if (msgClass.StartsWith("IPM.Note",
             StringComparison.OrdinalIgnoreCase))
         {
             if (m_senderName_List.Contains(msg.SenderName))
             {
                 //dest_Folder.AddMapiMessageItem(msg);
                 try
                 {
                     dest_Folder.AddMapiMessageItem(msg);
                 }
                 catch (Exception ex)
                 {
                     Console.WriteLine(
                         "FAILED\n" +
                         $"Folder      : {soucrce_folder.DisplayName}\n" +
                         $"Container   : {soucrce_folder.ContainerClass}\n" +
                         $"MsgClass    : {msgClass}\n" +
                         $"Subject     : {msgInfo.Subject}\n" +
                         $"Error       : {ex.Message}\n");
                 }
             }
             continue;
         }

         /////////
         
         if (msgClass.StartsWith("IPM.MessageManager",
 StringComparison.OrdinalIgnoreCase))
         {
             continue;
         }
         
         if (msgClass.StartsWith("REPORT.IPM.Note.NDR",
 StringComparison.OrdinalIgnoreCase))
         {
             continue;
         }

         if (msgClass.StartsWith("IPM.Outlook.Recall",
StringComparison.OrdinalIgnoreCase))
         {
             continue;
         }

         /////////
         else
         {
             //dest_Folder.AddMapiMessageItem(msg);
             try
             {
                 dest_Folder.AddMapiMessageItem(msg);
             }
             catch (Exception ex)
             {
                 Console.WriteLine(
                     "FAILED\n" +
                     $"Folder      : {soucrce_folder.DisplayName}\n" +
                     $"Container   : {soucrce_folder.ContainerClass}\n" +
                     $"MsgClass    : {msgClass}\n" +
                     $"Subject     : {msgInfo.Subject}\n" +
                     $"Error       : {ex.Message}\n");
             }
         }

i had to add these conditions to avoid the mismatching Container classes , but these messges are supposed to be in the folder.
that error mostly accrued in else section

Thank you for the additional details and for sharing the code snippet.

We will update you as soon as we have reproduced the scenario and have more information regarding whether this is expected behavior or a potential regression.