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

RelayLimit

public class RelayLimit extends org.apache.mailet.GenericMatcher
version
1.0.0, 1/5/2000

Fields Summary
int
limit
Constructors Summary
Methods Summary
public voidinit()


       
        limit = Integer.parseInt(getCondition());
    
public java.util.Collectionmatch(org.apache.mailet.Mail mail)

        MimeMessage mm = mail.getMessage();
        int count = 0;
        for (Enumeration e = mm.getAllHeaders(); e.hasMoreElements();) {
            Header hdr = (Header)e.nextElement();
            if (hdr.getName().equals(RFC2822Headers.RECEIVED)) {
                count++;
            }
        }
        if (count >= limit) {
            return mail.getRecipients();
        } else {
            return null;
        }