Noted : Kmail to Express

on OpenSUSE 10.3 my kmail emails were located on ~/.kde/share/apps/kmail/mail
On KDE4, the location of kmail emails is ~/.kde4/share/apps/kmail/mail

The procedure to upgrade kmail to office outlook was the following

1) backup your email
2) rename all files to eml
3) import into outlook express (create a dummy account)
4) import from outlook express to office outlook

in detail:

0) go to your kmail email folder
cd ~/.kde/share/apps/kmail/mail

1) tar all the email
tar cvf inbox.tar inbox/cur/*
tar cvf sent.tar sent-mail/cur/*

2) move it to a temp folder
mkdir ~/temp
mv *.tar ~/temp

3) untar inbox (procedure is the same for sent-mail, so I won’t repeat it here)
cd ~/temp
tar xvf inbox.tar
cd inbox/cur

4) rename all emails to EML extension, with a valid windows pathname
for f in `ls -1`; do f2=`echo $f | sed ‘s/[\.,]/_/g’`; mv -v $f $f2.eml; done

What this does is list all files in the current directory, then replace the dots (.) and commas (,) from the filenames by an underscore (_), and then adds the “eml” extension for outlook express

5) retar all the emails
tar cvf inbox.tar *.eml

6) move the tar file to your windows machine
7) on windows open up outlook express and create a dummy account. Discard all the errors. All that matters is that you create an account with or without valid mailbox settings, because we’ll drop all the EML files into the inbox
8) once outlook express is ready, drag all the email EML files (from the tarball) into the “inbox” folder

9) open Office Outlook. Go to File->Import/Export
10) select “From other program”
11) select “outlook express 3.x, 4.x, 5.x..”
12) discard the account setup popup boxes
13) it will start importing all your email from outlook express