Object content = mp.getContent();
Object content = Mime.getMessageContent(mp);
    private static void addParts(Element parent, MPartInfo mpi, MPartInfo body, String prefix) {        Element elem = parent.addElement(MailService.E_MIMEPART);        MimePart mp = mpi.getMimePart();                String part = mpi.getPartName();        part = prefix + (prefix.equals("") || part.equals("") ? "" : ".") + part;        elem.addAttribute(MailService.A_PART, part);                String contentTypeString = StringUtil.stripControlCharacters(mpi.getContentTypeString());        if (Mime.CT_XML_ZIMBRA_SHARE.equals(contentTypeString)) {            Element shr = parent.getParent().addElement("shr");            try {                getContent(shr, mpi);            } catch (IOException e) {                if (mLog.isWarnEnabled())                    mLog.warn("error writing body part: ", e);            } catch (MessagingException e) {            }        }                elem.addAttribute(MailService.A_CONTENT_TYPE, contentTypeString);                // figure out attachment size        try {            int size = mp.getSize();            if (size >= 0) {                if ("base64".equalsIgnoreCase(mp.getEncoding())) size = (int) ((size * 0.75) - (size/76));                elem.addAttribute(MailService.A_SIZE, size);            }        } catch (MessagingException me) {            // don't put out size if we get exception        }                // figure out attachment disposition        try {            String disp = mp.getHeader("Content-Disposition", null);            if (disp != null) {                ContentDisposition cdisp = new ContentDisposition(MimeUtility.decodeText(disp));                elem.addAttribute(MailService.A_CONTENT_DISPOSTION, StringUtil.stripControlCharacters(cdisp.getDisposition()));             }        } catch (MessagingException me) {        } catch (UnsupportedEncodingException uee) {        }                // figure out attachment name        try {            String fname = mp.getFileName();            if (fname == null && Mime.CT_MESSAGE_RFC822.equals(contentTypeString)) {                // "filename" for attached messages is the Subject                Object content = mp.getContent();                if (content instanceof MimeMessage)                    fname = ((MimeMessage) content).getSubject();            }            if (fname != null && !fname.equals(""))                elem.addAttribute(MailService.A_CONTENT_FILENAME, StringUtil.stripControlCharacters(fname));        } catch (MessagingException me) {        } catch (IOException ioe) {        }                // figure out content-id (used in displaying attached images)        try {            String cid = mp.getContentID();            if (cid != null)                elem.addAttribute(MailService.A_CONTENT_ID, StringUtil.stripControlCharacters(cid));        } catch (MessagingException me) { }                        // figure out content-location (used in displaying attached images)        try {            String cl = mp.getHeader("Content-Location", null);            if (cl != null)                elem.addAttribute(MailService.A_CONTENT_LOCATION, StringUtil.stripControlCharacters(cl));        } catch (MessagingException me) { }        // include the part's content if this is the displayable "memo part"        if (mpi == body) {            elem.addAttribute(MailService.A_BODY, true);            try {                getContent(elem, mpi);            } catch (IOException ioe) {                if (mLog.isWarnEnabled())                    mLog.warn("error writing body part: ", ioe);            } catch (MessagingException me) {            }        }                // recurse to child parts, if any        if (mpi.hasChildren()) {            for (Iterator it = mpi.getChildren().iterator(); it.hasNext();) {                MPartInfo cp = (MPartInfo) it.next();                addParts(elem, cp, body, prefix);            }        }    }