"BAD parse error: command not permitted with UID"

I’m using the Chilkat plugin to move emails to the trash/bin. One user sent me a log where moving to the trash doesn’t work.

I get a list of UIDs:

----IMAP REQUEST----
aaaf UID SEARCH NOT DELETED BEFORE 14-DEC-2023
----IMAP RESPONSE----

  • SEARCH 620615 620629 621143 621195 622010 622187 622227 623079 623420 623874 623881 623916 624023 624031 625137 625370 625398 625972 626136 626536 626558 626660 629975 630251 630341 630439 630455 631223 633413 635381 635398 635417 638365

And then the emails should be moved to the trash:

----IMAP REQUEST----
aaam UID MOVE 626558,626660,629975,630251,630341,630439,630455,631223,633413,635381 “Trash”
----IMAP RESPONSE----
aaam BAD parse error: command not permitted with UID

What does the error message mean and how do I fix it? The code is a simple

dim theResult as Boolean = CkoImap.MoveMessages(theMessageset, TrashMailboxes(0))

But the problem is more an IMAP problem and less a code one.

My guess is that the user is using a system that’s managed by an IT dept somewhere and that they are not allowed to actually delete emails. Usually in those situations there will be a folder called “archive” or “archived” instead.