code: private boolean checkConnectStatus() throws MessagingException {
          if (transport != null) {
              if (transport.isConnected()) {
                  logger.debug("当前邮箱处于在线状态");
                  return true;
              } else {
                  synchronized (this) {
                      if (!transport.isConnected()) {
                          try {
                              logger.debug("当前邮箱状态不正常，关闭重新开启");
                              transport.close();
                          } catch (Exception e) {
                              logger.error("关闭现有的transport异常");
                          }
                          return connect();
                      } else {
                          logger.debug("当前邮箱处于在线状态");
                          return true;
                      }
                  }
              }
          } else {
              synchronized (this) {
                  if (transport != null) {
                      return checkConnectStatus();
                  } else {
                      return connect();
                  }
              }
          }
      }
docs: 检查邮箱服务器连接状态
  
  @return 状态正常返回true，否则抛出异常
  @throws MessagingException 异常