Have a new iPhone 4 with an IMAP account set up. When you delete a message, it doesn't work. The error message is "Unable to move message - The message could not be moved to the trash folder."
The Trash folder is not properly set/named for the Trash / Deleted Messages folder on the server in the new iPhones. You have to set it manually to whatever is the name of the Trash folder. This is changed in the advanced settings. (This changed in iOS, but we first saw it on a new iPhone4 since, upgrades don't have this problem with the restore from iTunes.)
To get to the advanced settings for the IMAP account:
Settings (icon) --> Mail, Contact, Calendars (option) --> Under Accounts, select the account to modify --> Under IMAP, select the account again --> Click Advanced (option) --> Click the Deleted Mailbox entry --> Update the On My iPhone and the On the Server entries to the correct names of the folders.
For the new iPhone 4 iOS, you have to click Done or nothing will save. After selecting the Trash folder above. Continue below:
Click Advanced to return to the Advanced page --> click Account to go back to the Account page --> Click Done to return to the list of Accounts.
Now it is safe to click the Home button at the bottom to return the list of icons.