I’ve had problems with Mail.app behaving weird on Mavericks. As you know from an earlier post, I’m using GMail accounts and have set them up in the past so that GMail’s labels - which are different to imap folders - work.
To get Mail.app working with Gmail, you have to first take all accounts offline (via the menu). Then remove the [Gmail] imap path prefix in your settings:
On iOS 7 you need to remove the imap path prefix as well.
After that enable the All Mail in Gmails webfrontend:
Remove all [Gmail] prefixes from labels within Gmails webfrontend. Restart Mail.app and taking all accounts online again and you are back in business.
Additional note: I’ve had problems with search in Mail on Mavericks. I could find messages in system spotlight, but not within Mail.app. I’ve reset spotlight on the whole disk and now everything works like a charm.