String ctype = getContentType(bp);
String ctype = Mime.getContentType(bp);
        protected boolean visitMultipart(MimeMultipart multi, VisitPhase visitKind) throws MessagingException {            if (visitKind != VisitPhase.VISIT_BEGIN)                return false;            // we should never hit a multipart/alternative part -- ever            if (getContentType(multi).equals(Mime.CT_MULTIPART_ALTERNATIVE)) {                ZimbraLog.extensions.warn("unexpected multipart/alternative found; skipping");                return false;            }            Map<Integer, BodyPart> replacements = null;            try {                for (int i = 0; i < multi.getCount(); i++) {                    BodyPart bp = multi.getBodyPart(i);                    String ctype = getContentType(bp);                    if (ctype.equals(Mime.CT_MULTIPART_ALTERNATIVE) && bp instanceof MimeBodyPart) {                        Object content = Mime.getMultipartContent((MimeBodyPart) bp, ctype);                        if (content instanceof MimeMultipart) {                            BodyPart subpart = getPrimaryPart((MimeMultipart) content);                            if (subpart != null) {                                if (replacements == null)                                    replacements = new HashMap<Integer, BodyPart>();                                replacements.put(i, subpart);                            }                        }                    }                }            } catch (IOException e) {                ZimbraLog.extensions.warn("exception while traversing multipart; skipping", e);            } catch (MessagingException e) {                ZimbraLog.extensions.warn("exception while traversing multipart; skipping", e);            }            if (replacements == null || replacements.isEmpty())                return false;            // check to make sure that the caller's OK with altering the message            if (mCallback != null && !mCallback.onModification())                return false;            // and put the selected parts where the multipart/alternatives used to be            for (Map.Entry<Integer, BodyPart> entry : replacements.entrySet()) {                multi.removeBodyPart(entry.getKey());                multi.addBodyPart(entry.getValue(), entry.getKey());            }            return true;        }