Using IMAP server with the iPhone’s default app settings prevents messages from going to trash. The workaround is simple, just some extra settings in your iPhone:
By default, iOS attempts to delete IMAP email by moving the message to the phone’s local trash folder. This causes the error, “messages could not be moved to the trash folder”.
Now the fix:
Using your iPhone, tap Settings > Mail, Contacts, and Calendars > Accounts, select your E-mail account to modify > IMAP > Account > Swipe down to the bottom of the menu > Advanced.
Here you will want to change all 3 items under “Mailbox Behaviors”. Drafts, sent, and deleted. Click on each and set the setting to “On the server”, carefully matching the drafts mailbox to the “on the server” folder. Example: Drafts Mailbox > “On the server” > Drafts
Repeat for the remaining mailboxes and your app will function correctly for sent, drafts, and trash.
– M3server.com – Powerful and Friendly Web Hosting