private static String removeSubjectBlob(String subject){
  String subj=subject;
  while (subj.charAt(0) == OPEN_SQUARE_BRACKED) {
    int length=subj.length();
    subj=removeBlob(subject);
    int i=0;
    if (subj.length() > 0 && subj.charAt(i) == CLOSE_SQUARE_BRACKED) {
      i++;
    }
 else {
      return subject;
    }
    while (subj.charAt(i) == WS) {
      i++;
    }
    subj=subj.substring(i);
    if (length == subj.length()) {
      return subj;
    }
  }
  return subj;
}

private static String removeSubjectBlob ( String subject ) { String subj = subject ; while ( subj . charAt ( 0 ) == OPEN_SQUARE_BRACKED ) { int length = subj . length ( ) ; subj = removeBlob ( subject ) ; int i = 0 ; if ( subj . length ( ) > 0 && subj . charAt ( i ) == CLOSE_SQUARE_BRACKED ) { i ++ ; } else { return subject ; } while ( subj . charAt ( i ) == WS ) { i ++ ; } subj = subj . substring ( i ) ; if ( length == subj . length ( ) ) { return subj ; } } return subj ; }
remove the subj - blob subj - blob = " [ " * blobchar " ] " * wsp subj - refwd = ( " re " / ( " fw " [ " d " ] ) ) * wsp [ subj - blob ] " : " blobchar = % x01 - 5a / % x5c / % x5e - 7f ; any char except ' [ ' and ' ] '
