* .jms.Message, org.apache.mailet.Mail)
*/
protected void populateMailMimeMessage(Message message, Mail mail) throws MessagingException {
if (message instanceof BlobMessage) {
try {
BlobMessage blobMessage = (BlobMessage) message;
try {
// store url for later usage. Maybe we can do something
// smart for RemoteDelivery here
// TODO: Check if this makes sense at all
mail.setAttribute(JAMES_BLOB_URL, blobMessage.getURL());
} catch (MalformedURLException e) {
// Ignore on error
logger.debug("Unable to get url from blobmessage for mail " + mail.getName());
}
mail.setMessage(new MimeMessageCopyOnWriteProxy(new MimeMessageInputStreamSource(mail.getName(), blobMessage.getInputStream())));
} catch (IOException e) {
throw new MailQueueException("Unable to populate MimeMessage for mail " + mail.getName(), e);
} catch (JMSException e) {
throw new MailQueueException("Unable to populate MimeMessage for mail " + mail.getName(), e);