public void addUser(
      long companyId,
      long userId,
      String password,
      String firstName,
      String middleName,
      String lastName,
      String emailAddress) {

    try {
      CyrusServiceUtil.addUser(userId, emailAddress, password);

      // Expect

      String addUserCmd = PropsUtil.get(PropsKeys.MAIL_HOOK_CYRUS_ADD_USER);

      addUserCmd = StringUtil.replace(addUserCmd, "%1%", String.valueOf(userId));

      Runtime rt = Runtime.getRuntime();

      Process p = rt.exec(addUserCmd);

      ProcessUtil.close(p);
    } catch (Exception e) {
      _log.error(e, e);
    }
  }
 public void updatePassword(long companyId, long userId, String password) {
   try {
     CyrusServiceUtil.updatePassword(companyId, userId, password);
   } catch (Exception e) {
     _log.error(e, e);
   }
 }
 public void deleteEmailAddress(long companyId, long userId) {
   try {
     CyrusServiceUtil.deleteEmailAddress(companyId, userId);
   } catch (Exception e) {
     _log.error(e, e);
   }
 }
  public void updateEmailAddress(long companyId, long userId, String emailAddress) {

    try {
      CyrusServiceUtil.updateEmailAddress(companyId, userId, emailAddress);
    } catch (Exception e) {
      _log.error(e, e);
    }
  }
  public void deleteUser(long companyId, long userId) {
    try {
      CyrusServiceUtil.deleteUser(userId);

      // Expect

      String deleteUserCmd = PropsUtil.get(PropsKeys.MAIL_HOOK_CYRUS_DELETE_USER);

      deleteUserCmd = StringUtil.replace(deleteUserCmd, "%1%", String.valueOf(userId));

      Runtime rt = Runtime.getRuntime();

      Process p = rt.exec(deleteUserCmd);

      ProcessUtil.close(p);

      // Procmail

      String home = PropsUtil.get(PropsKeys.MAIL_HOOK_CYRUS_HOME);

      File file = new File(home + "/" + userId + ".procmail.blocked");

      if (file.exists()) {
        file.delete();
      }

      file = new File(home + "/" + userId + ".procmail.forward");

      if (file.exists()) {
        file.delete();
      }

      file = new File(home + "/" + userId + ".vacation");

      if (file.exists()) {
        file.delete();
      }

      file = new File(home + "/" + userId + ".vacation.cache");

      if (file.exists()) {
        file.delete();
      }
    } catch (Exception e) {
      _log.error(e, e);
    }
  }