org.apache.james.transport.matchers
Class HasMailAttribute

java.lang.Object
  extended by org.apache.mailet.base.GenericMatcher
      extended by org.apache.james.transport.matchers.HasMailAttribute
All Implemented Interfaces:
Matcher, MatcherConfig

public class HasMailAttribute
extends 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>">
 

Since:
2.2.0
Version:
CVS $Revision: 800345 $ $Date: 2009-08-03 14:00:44 +0100 (Mon, 03 Aug 2009) $

Constructor Summary
HasMailAttribute()
           
 
Method Summary
 java.lang.String getMatcherInfo()
          Return a string describing this matcher.
 void init()
           
 java.util.Collection match(Mail mail)
           
 
Methods inherited from class org.apache.mailet.base.GenericMatcher
destroy, getCondition, getMailetContext, getMatcherConfig, getMatcherName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HasMailAttribute

public HasMailAttribute()
Method Detail

getMatcherInfo

public java.lang.String getMatcherInfo()
Return a string describing this matcher.

Specified by:
getMatcherInfo in interface Matcher
Overrides:
getMatcherInfo in class GenericMatcher
Returns:
a string describing this matcher

init

public void init()
          throws javax.mail.MessagingException
Overrides:
init in class GenericMatcher
Throws:
javax.mail.MessagingException

match

public java.util.Collection match(Mail mail)
                           throws javax.mail.MessagingException
Specified by:
match in interface Matcher
Specified by:
match in class GenericMatcher
Parameters:
mail - the mail to check.
Returns:
all recipients if the condition is the name of an attribute set on the mail
Throws:
javax.mail.MessagingException


Copyright © 2008-2009 The Apache Software Foundation. All Rights Reserved.