ShellScript that emails you size of dir

I have this so far:

#!/bin/sh

FOLDER='/home';
MAXSIZE='50';
MAILADRES='username@server.com';

if [ "du -sm $FOLDER | cut -f 1" > "50" ] ; then
echo "$FOLDER too big" | /usr/sbin/sendmail $MAILADRES
echo "test";
fi

But i need to figure out how to have it search all the users on the system and then find there email address to email them if they have one.

You can start with something like this.

Of course this script need to be run with sudo or under root

#!/bin/ksh

MAXSIZE=50
USERID_BOUNDARY=1000 # normaly regular userid start at a certain number, low userid habitualy are reserved for the system and applications
IFS=":"

while read username two userid groupid five homedir rest
do
    if [ "$userid" -gt "$USERID_BOUNDARY" ] ; then
       MAILADRES="$username@server.com"
       if [ "du -sm $homedir | cut -f 1" > "$MAXSIZE" ] ; then
           echo "$homedir too big" | /usr/sbin/sendmail $MAILADRES
           echo "test";
       fi
    fi
done < /etc/passwd

Or you can try checking Quota