private static void catchMail() {
    //if (game.inbox().getPresentMailCount() == 0) {
    if (game.inbox().size() == 0) {
      logger.fine("no present mail");
      return;
    }

    for (Mail mail : game.inbox().getPresentMail()) {
      logger.fine("processing mail #" + mail.getId());

      // Calculate player's distance to target channel
      int distanceFromTarget = game.player().distanceFromTarget(mail.getChannel());

      // Move player right or left the needed times
      logger.fine("  moving player");
      for (int i = 0; i < Math.abs(distanceFromTarget); i++) {
        if (distanceFromTarget > 0) {
          game.control().right();
        } else if (distanceFromTarget < 0) {
          game.control().left();
        }
      }

      // Wait for mail to be caught or missed
      boolean wait = true;
      //while (mail.isUnknown()) {
      while (wait) {
        logger.fine("  waiting...");
        logger.fine("  " + mail.getState());

        if (!game.inbox().getAllMail().get(mail.getId()).isUnknown()) {
          wait = false;
        }

        try {
          Thread.sleep(250);
        } catch (InterruptedException e) {
          // nothing
        }
      }
    }
  }