@Override
  public String findMailAddressFor(User u) {
    String username = u.getId();

    for (JiraSite site : JiraProjectProperty.DESCRIPTOR.getSites()) {
      try {
        JiraSession session = site.createSession();
        if (session != null) {
          RemoteUser user = session.service.getUser(session.token, username);
          if (user != null) {
            String email = user.getEmail();
            if (email != null) {
              email = unmaskEmail(email);
              return email;
            }
          }
        }
      } catch (IOException ex) {
        LOGGER.log(Level.WARNING, "Unable to create session with " + site.getName(), ex);
      } catch (ServiceException ex) {
        LOGGER.log(Level.WARNING, "Unable to create session with " + site.getName(), ex);
      }
    }
    return null;
  }
  /**
   * Gets the {@link JiraSite} that this project belongs to.
   *
   * @return null if the configuration becomes out of sync.
   */
  public JiraSite getSite() {
    JiraSite[] sites = DESCRIPTOR.getSites();
    if (siteName == null && sites.length > 0)
      // default
      return sites[0];

    for (JiraSite site : sites) {
      if (site.getName().equals(siteName)) return site;
    }
    return null;
  }