[Users] Importing kmails complete mail corpus to claws

Nicolas Iselin nicolas.claws at iselin.ch
Thu May 23 21:52:23 CEST 2013

Hi all - to whom it may concern.

I also did a KMail to Claws Migration about a year ago. I had two or
three quite big Mail Corpuses (around 10000 mails) to migrate, I also
experimented with copying to a local IMAP folder - but I had too many
crashes while copying big subtrees.

By the way, all new users are very happy with Claws now :-)

My Migration worked as follows:

a) a few lines of shell code that can navigate through that funny
   mixed mbox/maildir directory structure that KMail is using
   (especially when you used KMail for years).

b) Make KMail read-only by changing the username of the pop-account(s).
c) manually "compress" (in KMail) all "folders" which use the mbox
   format otherwise "deleted" mails will reappear in step f).

d) manually rename all folders whose name start with "cur", "new" or
   "tmp" (this is a limitation of some of the conversion scripts used)

d) use the fragment from a) to COUNT all mails in all folders.

f) convert all mbox folders to maildir using a (slightly edited) version
   of the mb2md script (aptitude install mb2md).

g) Now that all KMail Mails are in maildir format, use
   kmail-mailbox2claws-mail.pl to import the mails. Some manual
   tweaking was needed for trash, drafts etc. Best to have them empty
   on migration.

h) use a different script to count all mails in all folders in the
   Claws format. This took about 2 to 3 hours manual work for every
   corpus. If you are not as paranoid as I am, you can save this
   step :-)

i) In addition I wrote a script that converts a KMail LDIF export of the
   addressbook into the Claws Addressbook XML Format. Partially, also
   "Mail Groups" (i.e. aliases representing multiple recipients) were

Of course, I did all this on a COPY of the KMail Files (so that there
would be a way back), and of course, like the other people have
described: There will be a "read only" period from the moment you start
the migration until you are fully up and running with claws.

The good thing is - as long as you do not download mails to claws with
the option "delete on server", you can try again and again until you
are satisfied.

Hope that helps someone. 

I am happy to share my scripts, but they are far away from "production
readiness", so no warranty and also only limited support ;-)


Am Thu, 23 May 2013 12:20:56 -0700
schrieb Vayu <vayu at sklinks.com>:

> Steve!  I hadn't seen the link that was in your post before I sent
> mine.  There is so much good info on this process, it appears to
> address my questions more than I could have hoped.  Much gratitude.
> On Thu May 23 12:12:15 PM Steve Litt wrote:
> > On Wed, 22 May 2013 12:48:17 -0400
> > Gene Heskett <gheskett at wdtv.com> wrote:
> > 
> > > Greetings all;
> > > 
> > > I would like to be able to do this so that kmail remains intact
> > > and usable until I have claws configured close enough to kmail
> > > that claws can take over with no gaps in the timeline.
> > 
> > Hi Gene,
> > 
> > I can't help you with a cutover that remains parallel. The way I
> > emigrated from Kmail involved a sharp cutover with a few
> > dayshttp://www.troubleshooters.com/lpm/201202/201202.htm of email
> > downtime. I did this after months of investigating the best way of 
> > doing it. Here are the details:
> > 
> > http://www.troubleshooters.com/lpm/201202/201202.htm
> > 
> > Basically, I got Dovecot running on my desktop machine. I grab my
> > email with fetchmail, which shoots each message to procmail for
> > deposit in the proper Dovecot email folder. So all my email is in
> > Dovecot, *not* in my email client. That way, if at a later date
> > Claws-Mail goes and does something stupid the way Kmail did
> > (Akonadi, etc), then I can drop in any IMAP aware email client. I
> > find it very reassuring to separate email creation and reading from
> > email storage, and will never again store my email in an email
> > client's format.
> > 
> > So my conversion required me to get my local Dovecot running, and
> > then, one at a time, within kmail I copied my folders to equivalent
> > IMAP folders in Dovecot. I could have copied whole folder trees,
> > but IMHO you'll have less problems if you don't copy excessively
> > big trees. During the conversion I could receive no email. I wanted
> > my IMAP tree to exactly match my Kmail tree. My records showed I
> > sent my last Kmail email at 2:35am on 2/3/2012, and sent my first
> > Claws email at 12:48pm on 2/4/2012, so I was down for a day and a
> > half.
> > 
> > HTH,
> > 
> > SteveT
> > 
> > 
> > 
> > _______________________________________________
> > Users mailing list
> > Users at lists.claws-mail.org
> > http://lists.claws-mail.org/cgi-bin/mailman/listinfo/users
> _______________________________________________
> Users mailing list
> Users at lists.claws-mail.org
> http://lists.claws-mail.org/cgi-bin/mailman/listinfo/users


More information about the Users mailing list