org.apache.james.transport.matchers
Class RecipientIsOverFixedQuota
java.lang.Object
org.apache.mailet.base.GenericMatcher
org.apache.james.transport.matchers.AbstractQuotaMatcher
org.apache.james.transport.matchers.AbstractStorageQuota
org.apache.james.transport.matchers.RecipientIsOverFixedQuota
- All Implemented Interfaces:
- org.apache.mailet.Matcher, org.apache.mailet.MatcherConfig
public class RecipientIsOverFixedQuota
- extends AbstractStorageQuota
Experimental: 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>
This matcher need to calculate the mailbox size everytime it is called. This can slow down things if there are many mails in
the mailbox. Some users also report big problems with the matcher if a JDBC based mailrepository is used.
- Version:
- 1.0.0, 2003-05-11
Method Summary |
protected long |
getQuota(org.apache.mailet.MailAddress recipient,
org.apache.mailet.Mail _)
|
void |
init()
Standard matcher initialization. |
Methods inherited from class org.apache.james.transport.matchers.AbstractQuotaMatcher |
isOverQuota, isSenderChecked, match, parseQuota |
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 |
RecipientIsOverFixedQuota
public RecipientIsOverFixedQuota()
init
public void init()
throws javax.mail.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:
javax.mail.MessagingException
getQuota
protected long getQuota(org.apache.mailet.MailAddress recipient,
org.apache.mailet.Mail _)
throws javax.mail.MessagingException
- Specified by:
getQuota
in class org.apache.james.transport.matchers.AbstractQuotaMatcher
- Throws:
javax.mail.MessagingException
Copyright ? 2002-2009 The Apache Software Foundation. All Rights Reserved.