use of com.zimbra.cs.mime.ExpandMimeMessage in project zm-mailbox by Zimbra.
the class MessageCache method expandMessage.
private static void expandMessage(MailItem item, CacheNode cnode, MimeMessage decryptedMimeMessage) throws MessagingException, ServiceException {
MimeMessage mimeToExpand = cnode.message;
if (decryptedMimeMessage != null) {
mimeToExpand = decryptedMimeMessage;
}
MimeMessage decodedMimeMessage = null;
if (Mime.isPKCS7Signed(mimeToExpand.getContentType())) {
if (SmimeHandler.getHandler() != null) {
ZimbraLog.mailbox.debug("The message is PKCS7 signed. Forwarding it to SmimeHandler for decoding.");
decodedMimeMessage = SmimeHandler.getHandler().decodePKCS7Message(item.getAccount(), mimeToExpand);
}
}
ExpandMimeMessage expander = new ExpandMimeMessage(decodedMimeMessage != null ? decodedMimeMessage : mimeToExpand);
expander.expand();
cnode.expanded = expander.getExpanded();
if (cnode.expanded != cnode.message) {
sDataSize += cnode.size;
cnode.size *= 2;
}
}
Aggregations