@Override
    public void itemStateChanged(ItemEvent e) {
      if (ListMailController.this.view.getCurrentHost() != null
          && !ListMailController.this
              .view
              .getCurrentHost()
              .equalsIgnoreCase(Configuration.getCurrentHost())) {
        if (ListMailController.this.view.getCurrentHost() != null) {
          Configuration.setCurrentHost(ListMailController.this.view.getCurrentHost());
        }

        for (MailboxNameChangeListener listener : ListMailController.this.nameChangeListeners) {
          listener.nameChanged(new NameChangeEvent(Configuration.getMyMailboxName()));
        }
        (new RefreshListWorker()).execute();
        try {
          MailboxCache.loadAllMailboxesFromServer();
        } catch (IOException
            | JavaInstallationMissingComponentsException
            | FailedCryptException
            | InvalidSignatureException
            | CommunicationFailureException e1) {
          ListMailController.this.view.setInfo(Utils.ppStackTrace(e1));
        }
      }
    }
 @Override
 protected Void doInBackground() {
   try {
     publish("Retrieving and decrypting mail list");
     String myMailboxName = Configuration.getMyMailboxName();
     if (myMailboxName != null) {
       TotalListItem[] listItems = WebServiceClient.getMailList(myMailboxName);
       for (TotalListItem item : listItems) {
         // decrypt them now, object will cache decrypted--doing it for the side effect
         item.getEncryptedListItem(Configuration.getMyPrivateKey());
       }
       ListMailController.this.model.setItems(listItems);
       publish("Mail list ready.");
       return null;
     }
     publish("No mailbox currently selected");
     ListMailController.this.model.clearItems();
     return null;
   } catch (CommunicationFailureException e) {
     publish(Utils.ppStackTrace(e));
     return null;
   } catch (FailedCryptException | JavaInstallationMissingComponentsException e) {
     publish(Utils.ppStackTrace(e));
     return null;
   } catch (RuntimeException e) {
     System.out.println(Utils.ppStackTrace(e));
     return null;
   }
 }