KMail (Kontact) mail directory structure?

Perhaps someone can enlighten me on how KMail managers its mail directories?

The mail data seem to be essentially stored in (for KDE 4, that is).: ~/.kde4/share/apps/kmail/mail

What I don’t understand is where it stores its 2nd-level subdirectories. I usually archive emails according to the following structure:

Local Folders
   > Inbox
   > Outbox
   > (etc.)
   > Friends
      > Peter
      > Paul
      > Mary
   > Firms
      > Amazon
      > Naughty bits
    (etc.)

In …/kmail/mail, there are corresponding folders for the 1st-level entries, i.e.: inbox, outbox, Friends, Firms, but I can’t find anything related to lower-level subfolders.

So far I also had problems when I tried to re-import kmail’s mail folders (I would only get a certain number of emails with others missing), and I suspect this might have to do with the mail folder management(?).

it depends on the type of mail folder you choose (it could be a file)
In my selection I have a directory named “Mail” under my home with the three you listed.

Hmmm, in my example above, I have 1st-level folders (Friends, Firms) and 2nd-level folders / subfolders (Peter, Paul, Mary, etc.). I can see the folders for Friends, Firms under the /kmail/mail directory, but there is nothing (neither a folder nor a file) that is related to Peter, Paul, Mary, etc.

So, where are these folders (and the emails inside of them) stored?