org.apache.james.transport.matchers
Class SenderIsRegex

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

public class SenderIsRegex
extends org.apache.mailet.base.GenericMatcher

Matches mails that are sent by a sender whose address matches a regular expression.

Is equivalent to the RecipientIsRegex matcher but matching on the sender.

Configuration string: a regular expression.


 <mailet match="SenderIsRegex=<regular-expression>" class="<any-class>">
 

The example below will match any sender in the format user@log.anything


 <mailet match="SenderIsRegex=(.*)@log\.(.*)" class="<any-class>">
 </mailet>
 

Another example below will match any sender having some variations of the string mp3 inside the username part.


 <mailet match="SenderIsRegex=(.*)(mp3|emmepitre)(.*)@" class="<any-class>">
 </mailet>
 

Since:
2.2.0
Version:
CVS $Revision: 717869 $ $Date: 2008-11-15 15:56:18 +0000 (Sat, 15 Nov 2008) $

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

Constructor Detail

SenderIsRegex

public SenderIsRegex()
Method Detail

init

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

match

public java.util.Collection match(org.apache.mailet.Mail mail)
Specified by:
match in interface org.apache.mailet.Matcher
Specified by:
match in class org.apache.mailet.base.GenericMatcher


Copyright ? 2002-2009 The Apache Software Foundation. All Rights Reserved.