break;
case MimeTokenStream.T_FIELD:
if (multiPartNesting == 0) {
Field field = stream.getField();
ParsedField parsedField = new DefaultFieldParser().parse(field.getName(), MimeUtil.unfold(field.getBody()), null);
if (parsedField.getParseException() != null) {
// TODO print error
} else if (parsedField.getName().equals(FieldName.TO)) {
message.to = ((AddressListField)parsedField).getAddressList();
} else if (parsedField.getName().equals(FieldName.CC)) {
message.cc = ((AddressListField)parsedField).getAddressList();
} else if (parsedField.getName().equals(FieldName.FROM)) {
message.from = ((MailboxListField)parsedField).getMailboxList();
} else if (parsedField.getName().equals(FieldName.SENDER)) {
message.sender = ((MailboxField)parsedField).getMailbox();
} else if (parsedField.getName().equals("List-Id")) {
message.listId = parsedField.getBody();
} else if (parsedField.getName().equals(FieldName.SUBJECT)) {
message.subject = parsedField.getBody();
}
}
break;
case MimeTokenStream.T_START_MULTIPART:
multiPartNesting++;