#!/bin/sh # MailView - Prints out a listing of all new (& unread) mail. #Retrieve some variables: . $HOME/.buffyrc; case $1 in #A listing of all mail, not just new stuff -all | all | -a ) { for FOLDER in $FOLDER_LIST; do if [ -s $MAILDIR/$FOLDER ]; then # if file is >0k in size echo "" echo "$B$FOLDER Messages:$UB" frm $MAILDIR/$FOLDER fi done } | $PAGER ;; #Otherwise, just show the new messages "") for FOLDER in $FOLDER_LIST; do new_num=`$GREP -c "$STATUS_NEW" $MAILDIR/$FOLDER` if [ $new_num -ne 0 ]; then echo "$B$FOLDER Messages:$UB" frm -s new -s unread $MAILDIR/$FOLDER fi done new_num=`$GREP -c "$STATUS_NEW" $MAIL` if [ $new_num -ne 0 ]; then echo "$B" echo "Inbox Messages:$UB" frm -s new -s unread fi ;; esac