#####################
# remove test files #
#####################

echo Cleaning up...

# cleanup the mysql sub tables so we can repeat if necessary
# the Log test will pass due to old data once we access the mysql log,
# rather than the file, but what the ...

  ${EZBIN}/ezmlm-rmtab "$DIR" \
  || fatal "ezmlm-rmtab failed"

  if [ -n "$SUBDB" ]; then
    ${EZBIN}/ezmlm-rmtab -S std "$DIR"
  fi

  ${EZBIN}/ezmlm-sub "$DIR" "$SENDER" 2>/dev/null \
  && fatal "ezmlm-sub worked after ezmlm-rmtab"

  ${EZBIN}/ezmlm-list "$DIR" 2>/dev/null | grep @ >/dev/null \
  && fatal "subscribers left in subdb after ezmlm-rmtab"

  test -e "$DIR"/subscribers \
       -o -e "$DIR"/allow/subscribers \
       -o -e "$DIR"/deny/subscribers \
       -o -e "$DIR"/digest/subscribers \
       -o -e "$DIR"/mod/subscribers \
  && fatal "ezmlm-rmtab didn't clean up properly."

  rm -rf "$DIR" "$ERR" >/dev/null 2>&1
