#4 Helper script to convert to Mozilla mail format

open
nobody
None
5
2004-04-20
2004-04-20
No

Hi, there

readpst is exactly what I was looking for, thanks.
I had to hack up a quick and dirty script (not much
error checking) to get the mbox files to play nice with
Mozilla, though, so here it is: maybe an improved
version, or an option to export in Mozilla format,
would be a nice addition to readpst:

Note: this assumes readpst was run with the -r
(recursive) option.

-------------------------------------------------------------------------------------

#!/bin/bash

if [ "$#" != 1 ]; then
echo "Usage: `basename $0` <folder>"
exit 1
fi

process_dir() {
echo Processing directory "$1"
for item in "$1/"*; do
if [ -d "$item" ]; then
mv "$item" "$item.sbd"
touch "$item"
process_dir "$item.sbd"
elif [ "`basename \"$item\"`" = mbox ]; then
mv "$item" "${item%%.sbd/mbox}"
else
echo ERROR: invalid item "$item"
exit 1
fi
done
}

item="$1"
mv "$item" "$item.sbd"
touch "$item"
process_dir "$item.sbd"

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks