FileDocCategorySizeDatePackage
HasMailAttribute.javaAPI DocApache James 2.3.12637Fri Jan 12 12:56:32 GMT 2007org.apache.james.transport.matchers

HasMailAttribute

public class HasMailAttribute extends org.apache.mailet.GenericMatcher

This Matcher determines if the mail contains the attribute specified in the condition, and returns all recipients if it is the case.

Sample configuration:


<mailet match="HasMailAttribute=whatever" class="<any-class>">
version
CVS $Revision: 494012 $ $Date: 2007-01-08 11:23:58 +0100 (Mo, 08 Jan 2007) $
since
2.2.0

Fields Summary
private String
attributeName
Constructors Summary
Methods Summary
public java.lang.StringgetMatcherInfo()
Return a string describing this matcher.

return
a string describing this matcher

        return "Has Mail Attribute Matcher";
    
public voidinit(org.apache.mailet.MatcherConfig conf)

        attributeName = conf.getCondition();
    
public java.util.Collectionmatch(org.apache.mailet.Mail mail)

param
mail the mail to check.
return
all recipients if the condition is the name of an attribute set on the mail

        if (mail.getAttribute (attributeName) != null) {
            return mail.getRecipients();
        } 
        return null;