Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A script to import messages into Mail from KMail, etc.' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to import messages into Mail from KMail, etc.
Authored by: yksrais on Nov 04, '06 05:27:33PM
Corrected working version:

1. uses the correct time date of E-Mail
2. bug fix (Email: -> Email

#!/bin/bash

mdirname='cur'

find . -name $mdirname | while read from; do
nm=`dirname $from | sed 's/[^a-zA-Z0-9]/-/g; s/^-*//; s/--*/-/' `
echo "Converting $from into $nm"

/bin/ls -1 "$from" | while read message; do
echo -n `cat $from/$message | grep '^From:' | head -n1 | sed 's/.*]*)>.*/From 1/' | sed 's/^From:/From /'; cat $from/$message | grep -m 1 '^Date:' | sed 's/,//g' | awk '{print $2" "$4" "$3" "$6" "$5 }'`
echo
cat $from/$message | sed 's/^From /From:/'
done > $nm.mbox
done
(C) 2006 linux2macSwitcher

[ Reply to This | # ]