String body = "bar\r\n.\r\n";
protected MimeMessage getMessageFromSources(String sources) throws Exception {
MimeMessageInputStreamSource mmis = null;
try {
mmis = new MimeMessageInputStreamSource("test", new SharedByteArrayInputStream(sources.getBytes()));
} catch (MessagingException e) {
}
return new MimeMessageCopyOnWriteProxy(mmis);
// return new MimeMessage(Session.getDefaultInstance(new Properties()),new ByteArrayInputStream(sources.getBytes()));
}