#!/bin/sh
# Script to be called by other scripts. Also see comments in showhashtype script
# Exit codes are,
#  3 syntax error
#  2 user not setup
#  0 is a user
#  1 is an alias
if [ $# -ne 1 ]
then
  exit 3
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 2
  fi
fi
