// Disable line length... This should be handled by the smtp server
// component and not the parser itself
// https://issues.apache.org/jira/browse/IMAP-122
MimeConfig config = new MimeConfig();
config.setMaxLineLen(-1);
final MimeTokenStream parser = new MimeTokenStream(config, new DefaultBodyDescriptorBuilder());
parser.setRecursionMode(RecursionMode.M_NO_RECURSE);
parser.parse(tmpMsgIn.newStream(0, -1));
EntityState next = parser.next();
while (next != EntityState.T_BODY && next != EntityState.T_END_OF_STREAM && next != EntityState.T_START_MULTIPART) {