akonadi / kmail / gmail

Duncan 1i5t5.duncan at cox.net
Sat Aug 25 08:54:58 BST 2018


dep posted on Fri, 24 Aug 2018 16:30:17 +0000 as excerpted:

> this leaves claws. and, finally, my question: is there any utility that
> will import kmail mailboxen into claws? or to a format that claws can
> then import? as noted, i have 20 years of email archives and would like
> to be able to get to them without bringing up a different application,
> i.e. kmail
> 
> so . . . any import filters, either built-in or third-party?

Yes.  Actually, importing years (nearly a decade on kmail, with imports 
from MSOE into kmail from before that) of local mail archives into claws-
mail was one of my major kmail -> claws-mail switch issues as well, but 
there are tools that can do it.

Note that various versions of kmail have supported and/or defaulted to 
two different formats, maildir and mbox.  Claws has a plugin (mailMBOX) 
that handles mbox so AFAIK if that's what your kmail is using, you should 
be able to simply use that plugin and not have to do any conversion.  
However, the mbox format puts all mails within a single "folder" into the 
same file, thus eliminating some of the scriptability options you have 
with mh-format, and, because there's multiple mails in one file, it's 
also a bit less robust as damage to a single file risks the entire 
folder's worth of messages.

So I was using maildir as I knew its file-per-message format was more 
robust, and AFAIK, that's all newer kmail supports -- I don't believe it 
supports actually working with mbox any longer except to convert it -- 
tho I could be wrong.

Anyway, there are at least two and likely three methods available to 
convert maildir to mh-dir format.

* While this reminder shouldn't be necessary, just in case...  Please 
copy/backup your existing mail archive before trying any conversion, just 
in case it doesn't go as expected.  Most conversion tools will treat the 
source as read-only and put the conversion in a new location, but it's 
definitely a lot less stressful to know you have a backup if something 
goes wrong!

1) I used the conversion script method, tho honestly it might require a 
bit more technical skill than some people have, because...

At the claws-mail website there's a page of third-party contributed 
tools, including several scripts that convert mailboxes from various 
formats to claws-native mh-dir format.

https://www.claws-mail.org/tools.php

IIRC I used the kmail-mailbox2claws-mail.pl perl script.  However, it's 
about a decade old and designed to work with an older perl.  When I ran 
it with my then-current perl, at first it errored out.  However, while 
I'm definitely /not/ a perl hacker, with a bit of patient hacking the 
script based on what the errors said, I was able to get it to work within 
a few hours, and it did the conversion quite well.

2) The console-based email program mutt supports both maildir and mh-dir 
formats, and apparently has a converter that lets you convert between 
them.  A number of people have reported that they were able to install it 
temporarily, and use its converter to convert from kmail's maildir to 
claws-mail's mh-dir format.  While I used the script method above, I 
believe this method will be easier for most, and if I were doing it over 
again I believe I'd try this way first.

3) There are additional scripts available for converting mbox or tbird's 
format (whatever it is) to mh-dir, and as I said, claws has a plugin that 
handles mbox directly as well.  It's thus likely to be possible to do a 
two-stage conversion as well, using some other mail client conversion 
utility to convert first to the mbox standard or to tbird's format, then 
either using the mbox directly with claws' mailMBOX plugin, or using one 
of the mbox to mh-dir conversion scripts from the claws tools page to do 
the final conversion.

* Again a reminder, please ensure you have your existing mail archive 
backed up before attempting to convert it, just in case!

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman





More information about the kde mailing list