String subject = message.getSubject();
out.println(subject)
ByteArrayOutputStream output = new ByteArrayOutputStream();
message.writeTo(output);
String raw = output.toString();
int subjectIdx = raw.indexOf("Subject:");
int offIdx = raw.indexOf("\n",subjectIdx);
String sub = raw.substring(subjectIdx + 9, offIdx);