You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
692 B
29 lines
692 B
#!/bin/bash |
|
# This script converts MH mail folders to the folders that KMail |
|
# prefers (all messages in one file) |
|
# |
|
# usage: mh2kmail <dirname> |
|
# |
|
# Author: Stefan Taferner <taferner@kde.org> |
|
# This script is under GPL |
|
# |
|
if [ "X$*" = "X" ]; then |
|
echo "usage: mh2kmailr <dirname>" |
|
exit 0 |
|
fi |
|
|
|
MH_DIR=$1 |
|
|
|
for d in `/usr/bin/find $MH_DIR -type d -print|sed -e :a -e 's/^.\{1,5\}$/ &/;ta'|sort`; do |
|
FOLDER=${d}.mbx |
|
|
|
# remove old kmail folder if any |
|
rm -f $FOLDER |
|
|
|
for f in `/usr/bin/find $d -type f -maxdepth 1 -print|sed -e :a -e 's/^.\{1,5\}$/ &/;ta'|sort`; do |
|
echo "From ???@??? 00:00:00 1997 +0000" >> $FOLDER |
|
cat $f >> $FOLDER |
|
done |
|
|
|
echo "Done. Messages stored in file $FOLDER." |
|
done
|
|
|