File indexing completed on 2024-12-22 05:01:13

0001 #!/bin/bash
0002 # This script converts MH mail folders to the folders that KMail
0003 # prefers (all messages in one file)
0004 #
0005 # usage:  mh2kmail <dirname>
0006 #
0007 # SPDX-FileContributor: Stefan Taferner <taferner@kde.org>
0008 # SPDX-License-Identifier: GPL-2.0-only
0009 #
0010 if [ "X$*" = "X" ]; then
0011   echo "usage: mh2kmail <dirname>"
0012   exit 0
0013 fi
0014 
0015 MH_DIR=$1
0016 FOLDER=${MH_DIR}.mbx
0017 
0018 # remove old kmail folder if any
0019 rm -f $FOLDER
0020 
0021 for f in `/bin/ls $MH_DIR|sed -e :a -e 's/^.\{1,5\}$/ &/;ta'|sort`; do
0022   echo "From ???@??? 00:00:00 1997 +0000" >> $FOLDER
0023   cat $MH_DIR/$f >> $FOLDER
0024 done
0025 
0026 echo "Done. Messages stored in file $FOLDER."
0027