diff contrib/moz-script @ 16:c508ee15dfca

switch to automake/autoconf
author carl
date Sun, 19 Feb 2006 18:47:46 -0800
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/moz-script	Sun Feb 19 18:47:46 2006 -0800
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# Helper script to convert to Mozilla mail format
+# Author: David Binard <binard@users.sf.net>
+
+# Taken from:  <http://sourceforge.net/tracker/index.php?func=detail&aid=938792&group_id=18756&atid=318756>
+# Note: this assumes readpst was run with the -r
+# (recursive) option.
+
+
+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"
+