In it's most crude form something like
Code:
[ `mailq 2>/dev/null| grep " Kbytes " | awk '{print $5}'` -gt 200 ] && doSomething
could work but this doesn't have any errorchecking so if the result is unexpected all hell breaks loose. Then again the idea of *emailing alerts* when the mail queue is full, well... ;-p