I recently moved from using KMail to using Thunderbird. Transferring the old email is non-trivial. Not only are the directory structure different, but KMail can use the maildir format for the folders, whereas Thunderbird only supports mbox format. When googling for a solution, I found the kmail2evo.py program which converts old email from KMail to Evolution. As Evolution also uses mbox format, I was able to hack the script to build a Thunderbird compatible directory structure. Follow these instructions at your own risk!
python kmail2thunder.pyIt will parse all your mail in ~/Mail and copy it to ~/tmpmail. You can use the -e option to the script to direct output directly to Thunderbird's Local Mail folder, but I do not recommend it. The script have other options that I have not tested, run it with the -h option to see the help screen.
cd tmpmail find . -type d -empty -exec rm {} +