if (mail == null) return null;
MimeMessage message = mail.getMessage();
if (message == null) return null;
if ((message.isMimeType("application/x-pkcs7-mime")
|| message.isMimeType("application/pkcs7-mime")) && (message.getContentType().indexOf("smime-type=enveloped-data") != -1)) {
return mail.getRecipients();
} else return null;