#!/bin/sh

. /etc/rc.common

##
# Clean up stale lock files on boot
##

if [ "$1" == "start" ]
then
	dirs=`nidump passwd / | sed 's/:[^:]*$//' | sed 's/.*://'`
	for i in $dirs
	do
		dir="$i/Library/Mail"
		if [ -d "$dir" ]
		then
			find "$dir" -fstype local -name .lock -exec rm -f {} \;
		fi
	done
fi
