To add a bit to the other replies, where your local MTA is sendmail then the mailq command is essentially an alias to sendmail -bp and so emptying $PATH shouldn't cause a problem, however some other MTAs operate differently and only provide the mailq command for compatibility with sendmail - in these places it is likely that mailq is a shell script (as you have seen), your best bet is not to set the $ENV{PATH} to '' but to set it to some (relatively) safe valuee such as '/bin:/usr/bin'. Alternatively you could edit the mailq script to provide the full path for the commands it can't find.