'Alien' folders cluttering up imported Mailboxes


Unlike the experience of a few others, my recent upgrade to Mavericks has ended up fine, with a clean re-installation dealing with what had been an abysmally sluggish performance following a simple upgrade - apart from a minor problem with my imported Mail backup (and once I'd been shown where my User Library folders were hidden):

What are the 'alien' folders that have nested themselves beneath my subject folders? For example, "Extended warranties" in the attached illustration: View attachment Nested bumph.pdf

The "Messages" folder(s) contain, between them, duplicates of the emails in my subject folders; though sometimes they are all found in the first "Messages" folder, in which case there isn't the second nesting seen here.

They appear to serve no purpose. But having been unable to find a way of avoiding importing them and having an aversion to clutter, I had no choice other than to slog through all 2 GB of my Mailboxes and weed them out, one by one. The only consequence has been that Mail now opens quicker.

What has happened? Could they have been avoided? And whilst I am unaware of any, has weeding them out done any harm?
Hello again,

What does my Gmail Web interface show? - View attachment Gmail web interface.pdf

I'm afraid I've managed to butcher my Gmail web interface. I got so pissed of with (my inability to control?) Gmail's seemingly anarchic intrusion into my preferred organization of my Mail at my end. When, after a previous re-installation of Mail I found Gmail flooding my mailboxes with every email on their files from the year dot, I embarked upon a wholesale deletion of all the duplicate mailboxes they insisted upon adding to my Mail at my end, together with the historic emails at their end. I guess this was not exactly a scientifically controlled exercise . . .

Thank you for the two links. I will follow these up later today.

Yes, these mailboxes were all from a backup that preceded a clean re-installation of my Mavericks. And I did use Rebuild on them, but saw no difference.