/** * Delete all the attachments. * @param nm * the normalized message * @throws MessagingException * impossible to delete the message */ private static void deleteAllAttachments(final NormalizedMessage nm) throws MessagingException { // Delete all attachments if (nm.getAttachmentNames() != null) { for (Object attachmentName : nm.getAttachmentNames()) { nm.removeAttachment((String) attachmentName); } } }