code: @Override
      public void process(ImapRequestLineReader request,
                          ImapResponse response,
                          ImapSession session) {
          try {
              doProcess(request, response, session);
          } catch (FolderException e) {
              log.warn("Error processing command", e);
              response.commandFailed(this, e.getResponseCode(), e.getMessage());
          } catch (AuthorizationException e) {
              log.warn("Error processing command due to authentication", e);
              String msg = "Authorization error: Lacking permissions to perform requested operation.";
              response.commandFailed(this, msg);
          } catch (ProtocolException e) {
              String msg = e.getMessage() + " Command should be '" +
                      getExpectedMessage() + '\'';
              log.warn("Error processing command: {}", msg, e);
              response.commandError(msg);
          }
      }
docs: Template methods for handling command processing. This method reads
  argument values (validating them), and checks the request for correctness.
  If correct, the command processing is delegated to the specific command
  implementation.
  
  @see ImapCommand#process