#!/bin/bash

getent passwd \
| awk -F: '$3 == 0 || $3 >= 1000 && $1 != "nobody" {print $1}' \
| while read username; do
    test -f /var/mail/${username} || install -m660 -o${username} -gmail /dev/null /var/mail/${username}
  done
