I've had a couple of users complain about not being able to delete messages.
The cause turns out to be that they don't have a Trash folder.
The attached diff/patch avoids this by creating the Trash folder if it doesn't exist before moving a message into it.
The only problem is that even though the Trash folder is created, it doesn't show up in the folders list until the whole folders list is refreshed.
-- Jacob Brunson Department of Chemistry, BYU