/**
  * Deletes the email account with the given id.
  *
  * @param accountID acoount id
  * @throws com.funambol.email.exception.EntityException
  * @return number of deleted rows
  */
 public int deleteAccount(long accountID) throws EntityException {
   int numDeleted = 0;
   try {
     long[] principalIds = cdao.getPrincipals(accountID);
     numDeleted = cdao.deleteUser(accountID, principalIds);
   } catch (DBAccessException e) {
     throw new EntityException("Error deleting account with id " + accountID, e);
   }
   return numDeleted;
 }