All application data should be stored in ~/.kde
kmail used to use ~/Mail for email storage, but since kde 3.4 or so also uses ~/.kde
Backing up/restoring that directory restores your previous kde profile, including application data.
kde also stores stuff in /tmp/kde-username and /var/tmp/kdecache-username.
you can define the location of ~/.kde with the environment variable
KDEHOME
For example, put
export KDEHOME=~/whatever in ~/.bashrc or /etc/profile to make kde use the directory ~/whatever, in stead of ~/.kde
More information can be found in the user guide of kde that ships with the desktop, or on internet at
http://docs.kde.org