#!/bin/sh
# Script to be called by other scripts:
# Exit codes are,
# -2 syntax error
# -1 user not setup
#  0 is a user
#  1 is an alias
if [ $# -ne 1 ]
then
  exit -2
else
  mailpath="`showhashdir $1`"
  mailbox="`hashop $1 pwd 2> /dev/null`"
  if [ -n "$mailbox" ]
  then
    if [ "$mailpath" = "$mailbox" ]
    then
      exit 0
    else
      exit 1
    fi
  else
    exit -1
  fi
fi
