KMail is part of the kdepim package of KDE (there's currently no package that contains only KMail). You will also need kdelibs and kdebase for using KMail. How to get KDE.

The current KMail development version is in HEAD branch in KDE's SVN. There's a page that describes how to download and install the KDE source.

If you're looking for import tools etc see the tools page.