#!/bin/sh # mdmail v1.0 by tibim (12/26/00) # Very simplistic shell script to check for new mail with QMAIL's MAILDIR. # Set this script to run each time a user logs in. # Please mail comments/suggestions to tibim@stratius.com if [ ! -d "$HOME/Maildir/new" ] || [ ! -d "$HOME/Maildir/cur" ] || [ ! -d "$HOME/Maildir/tmp" ]; then echo "Error: $HOME/Maildir is not a valid Maildir." 1>&2 echo "Please run \"/var/qmail/bin/maildirmake ~/Maildir\" to create Maildir." 1>&2 exit 1 fi MAILNUM=`ls \$HOME\/Maildir/new/ | wc -w | awk '{print $1}'` if [ $MAILNUM = "0" ]; then echo "No mail for $USER." exit 0 fi if [ $MAILNUM = "1" ]; then echo "You have new mail. 1 message waiting." else echo "You have new mail. $MAILNUM messages waiting." fi