DeleteMessages with empty list causes "AE_1_1_0018 BAD Could not parse command"


We have updated our product from .NET 4.8 to .NET 6 and we have detected a difference of behavior between the DLL Aspose.Email in version for .NET 4.8 and .NET 6.

The following source code has a different behavior in .NET 6:

ic.DeleteMessages(ic.ListMessages().Select(m => m.UniqueId));

The C# method doesn’t accept an empty list in .NET 6 and causes an IMAP error “AE_1_1_0018 BAD Could not parse command” whereas it was well managed in .NET 4.8.

At this moment, I have protected this action like this:

IEnumerable<string> listMessage = ic.ListMessages().Select(m => m.UniqueId);
if (listMessage != null && listMessage.Any() > 0)

Can you check this behavior and let me know if it would be fixed in the future.


Hello, @nmi

Thank you for contacting the support forum and providing a thorough description of your issue.
We have opened the following new investiagtion ticket in our internal issue tracking system.

Issue ID(s): EMAILNET-41189

We will investigate the issue and if it is confirmed, fix it.
Sorry for the inconvenience.

Thanks for your quick answer.
Is it possible to give us a feedback in this thread when it would be fixed or not ?

Hello @nmi,

Sure, we’ll let you know the status of this issue.

Hi @nmi
On our side, with an empty set of UniqueIds, an error occurs both with the Framework and .NET6 version. Therefore, we decided to add an exception that will prevent the call Delete command with an empty set of UniqueIds. We believe that your code is useful and will allow to avoid errors in the future.