Search in sources :

Example 1 with ExpandMimeMessage

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;
    }
}
Also used : ExpandMimeMessage(com.zimbra.cs.mime.ExpandMimeMessage) MimeMessage(javax.mail.internet.MimeMessage) ExpandMimeMessage(com.zimbra.cs.mime.ExpandMimeMessage)

Aggregations

ExpandMimeMessage (com.zimbra.cs.mime.ExpandMimeMessage)1 MimeMessage (javax.mail.internet.MimeMessage)1