change KTTSD to Jovie
[kdepim.git] / kmail / mh2kmailr
blobd88905aae20421c846d0160610c5fd4fd275b282
1 #!/bin/bash
2 # This script converts MH mail folders to the folders that KMail
3 # prefers (all messages in one file)
5 # usage: mh2kmail <dirname>
7 # Author: Stefan Taferner <taferner@kde.org>
8 # This script is under GPL
10 if [ "X$*" = "X" ]; then
11 echo "usage: mh2kmailr <dirname>"
12 exit 0
15 MH_DIR=$1
17 for d in `/usr/bin/find $MH_DIR -type d -print|sed -e :a -e 's/^.\{1,5\}$/ &/;ta'|sort`; do
18 FOLDER=${d}.mbx
20 # remove old kmail folder if any
21 rm -f $FOLDER
23 for f in `/usr/bin/find $d -type f -maxdepth 1 -print|sed -e :a -e 's/^.\{1,5\}$/ &/;ta'|sort`; do
24 echo "From ???@??? 00:00:00 1997 +0000" >> $FOLDER
25 cat $f >> $FOLDER
26 done
28 echo "Done. Messages stored in file $FOLDER."
29 done