org.apache.james.transport.matchers
Class RecipientIsOverFixedQuota

java.lang.Object
  extended byorg.apache.mailet.GenericMatcher
      extended byorg.apache.james.transport.matchers.AbstractQuotaMatcher
          extended byorg.apache.james.transport.matchers.AbstractStorageQuota
              extended byorg.apache.james.transport.matchers.RecipientIsOverFixedQuota
All Implemented Interfaces:
Matcher, MatcherConfig

public class RecipientIsOverFixedQuota
extends AbstractStorageQuota

Checks whether a recipient has exceeded a maximum allowed quota for messages standing in his inbox. Such quota is the same for all users.

Will check if the total size of all his messages in the inbox are greater than a certain number of bytes. You can use 'k' and 'm' as optional postfixes. In other words, "1m" is the same as writing "1024k", which is the same as "1048576".

Here follows an example of a config.xml definition:


 <processor name="transport">
 .
 .
 .
    <mailet match=match="RecipientIsOverFixedQuota=40M" class="ToProcessor">
       <processor> error </processor>
       <notice>The recipient has exceeded maximum allowed size quota</notice>
    </mailet>
 .
 .
 .
 </processor>
 

Version:
1.0.0, 2003-05-11

Constructor Summary
RecipientIsOverFixedQuota()
           
 
Method Summary
protected  long getQuota(MailAddress recipient, Mail _)
          Gets the quota to check against.
 void init()
          Standard matcher initialization.
 
Methods inherited from class org.apache.james.transport.matchers.AbstractStorageQuota
getPrimaryName, getUsed, isRecipientChecked
 
Methods inherited from class org.apache.james.transport.matchers.AbstractQuotaMatcher
isOverQuota, isSenderChecked, match, parseQuota
 
Methods inherited from class org.apache.mailet.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

RecipientIsOverFixedQuota

public RecipientIsOverFixedQuota()
Method Detail

init

public void init()
          throws MessagingException
Standard matcher initialization. Does a super.init() and parses the common storage quota amount from config.xml for later use.

Overrides:
init in class AbstractStorageQuota
Throws:
MessagingException

getQuota

protected long getQuota(MailAddress recipient,
                        Mail _)
                 throws MessagingException
Description copied from class: AbstractQuotaMatcher
Gets the quota to check against.

Specified by:
getQuota in class AbstractQuotaMatcher
Parameters:
recipient - the address holding the quota if applicable
_ - the mail involved if needed
Throws:
MessagingException


"Copyright © 1999-2006 Apache Jakarta Project. All Rights Reserved."