Post by PaulPost by Adam FunkI currently have a ~/Mail in maildir format containing about 24,000
e-mails in 190 MB. I guess I'll need to convert that to MH format,
presumably using kmail-mailbox2claws-mail.pl (in the
claws-mail-tools package). How reliable is it?
It seems it's a mixed bag - for some it works, for some it has
problems. Anyway, it is non-destructive, so there's no harm giving it
a go.
It didn't work for me ... I got a lot of errors about undefined
variables in a string comparison and no files in the output directory.
Post by PaulAlternately, Hanno Böck sent me the attached bash script, which does
the same thing. It would be useful if you could test this, Hanno sent
it to me as a replacement for kmail-mailbox2claws-mail.pl, but I've
not found the time to create a dummy kmail mailbox to test it on yet.
Please report how you got on with either or both. Thanks!
I modified it slightly (see below) and it worked, although when I ran
it with the arguments 'Mail_KMail' and 'Mail', it put all the output
in a 'MailMail_Kmail' directory. I decided renaming that to Mail
would be easier than manipulating sed (in which I'm not fluent). The
results worked perfectly in Claws.
I'm really impressed with Claws so far. I wish I'd switched to it
years ago.
##################################################
#!/bin/bash
# changed from /bin/sh to get let cmd
# this script converts a kmail directory structure to claws-mail MH format
#
# by Hanno Boeck, http://www.hboeck.de/
#
# I, the copyright holder of this work, hereby release it into the public
# domain. This applies worldwide.
# In case this is not legally possible:
# I grant anyone the right to use this work for any purpose, without any
# conditions, unless such conditions are required by law.
if [ -z $1 ] || [ -z $2 ]; then
echo "Usage: kmail-to-claws [fromdir] [todir]"
exit -1
fi
echo Converting from $1 kmail dir to $2 claws/mh dir
#for i in `find -type d -name cur`; do
for i in `find $1 -type d -name cur`; do
#export oldname=$1`echo $i|sed -e 's:cur$::g' -e 's:^\./:/:g'`
export oldname=`echo $i|sed -e 's:cur$::g' -e 's:^\./:/:g'`
export newname=$2`echo $oldname|sed -e 's:\.\(\w*\).directory:\1:g'`
echo progress: $oldname to $newname
count=0
mkdir -p $newname
for file in `ls $oldname/cur/`; do
let count++
cp $oldname/cur/$file $newname/$count
done
for file in `ls $oldname/new/`; do
let count++
cp $oldname/new/$file $newname/$count
done
done