6.1

Table Of Contents
details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
-->
<plugin>
<!-- extracted to: pdk/work/scripts/sendmail/hq-sendmail-stat -->
<script name="hq-sendmail-stat">
<![CDATA[
#!/bin/sh
# linux / aix
[ -d "/var/spool/mqueue" ] &&
msgdir="/var/spool/mqueue" &&
premsgdir="/var/spool/clientmqueue"
# solaris
[ -d "/usr/spool/mqueue" ] &&
msgdir="/usr/spool/mqueue" &&
premsgdir="/usr/spool/clientmqueue"
# If the mqueue dir doesn't exist, exit 1
[ -z "$msgdir" -o ! -r "$msgdir" ] &&
exit 1
# May not have permission to cd to the mqueue, make sure
# stdout/err don't get echo'd
cd $msgdir > /dev/null 2>&1
[ "$?" != "0" ] &&
exit 1
# count msgs in sendmail mqueue dir. DO NOT use find since it
# may fail when there are lots of files
messfiles=`ls 2>/dev/null | wc -w`
premessfiles=0
if [ ! -z "$premsgdir" ] && [ -d "$premsgdir" ] && [ -r "$premsgdir" ]
then
[ `cd $premsgdir > /dev/null 2>&1` ] && [ "$?" = "0" ] &&
premessfiles=`ls 2>/dev/null | wc -w`
fi
echo MessagesInQueue=$messfiles
echo MessagesAwaitingPreprocessing=$premessfiles
exit 0
]]>
</script>
<server name="Sendmail"
version="8.x">
Chapter 1 Introduction to Plug-in Development
VMware, Inc. 17