String getMimeType(AbstractMessage msg) { Attachments atts = msg.getAttachments(); if (atts != null && atts.size() > 0) { return atts.getContentType(); } else { return getSoapMimeType(msg); } }