#!/bin/bash
#
# ::copy::
# ::maintainer::
#
CMD=$(basename $0)
CMDVER="1.0 2010/08"

SAVE_IFS="$IFS"
IFS=":"

getent passwd | while read user trush uid gid gecos home shell
do
	egrep -q "[ ,	]$user$|[ ,	]$user@" /etc/postfix/virtual || continue

	printf "  check %-12s " $user

	if [ -d "$home" ]
	then
		echo "ok"
	else
		su - $user -c "exit 0"	# PAM autocreate dirs
	fi
done

exit 0
