FileDocCategorySizeDatePackage
IsSMIMEEncrypted.javaAPI DocApache James 2.3.12110Fri Jan 12 12:56:32 GMT 2007org.apache.james.transport.matchers.smime

IsSMIMEEncrypted

public class IsSMIMEEncrypted extends org.apache.mailet.GenericMatcher
Checks if a mail is smime encrypted.

Fields Summary
Constructors Summary
Methods Summary
public java.util.Collectionmatch(org.apache.mailet.Mail mail)

see
org.apache.mailet.Matcher#match(org.apache.mailet.Mail)

        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;