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

RecipientIsOverFixedQuota

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

Fields Summary
private long
quota
Constructors Summary
Methods Summary
protected longgetQuota(org.apache.mailet.MailAddress recipient, org.apache.mailet.Mail _)

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


                           
         
        super.init();
        quota = parseQuota(getCondition().trim().toLowerCase(Locale.US));