FileDocCategorySizeDatePackage
CommandForListserv.javaAPI DocApache James 2.3.12210Fri Jan 12 12:56:30 GMT 2007org.apache.james.transport.matchers

CommandForListserv

public class CommandForListserv extends org.apache.mailet.GenericRecipientMatcher
Returns positive if the recipient is a command for a listserv. For example, if my listserv is james@list.working-dogs.com, this matcher will return true for james-on@list.working-dogs.com and james-off@list.working-dogs.com.

Fields Summary
private org.apache.mailet.MailAddress
listservAddress
Constructors Summary
Methods Summary
public voidinit()

        listservAddress = new MailAddress(getCondition());
    
public booleanmatchRecipient(org.apache.mailet.MailAddress recipient)

        if (recipient.getHost().equals(listservAddress.getHost())) {
            if (recipient.getUser().equals(listservAddress.getUser() + "-on")
                || recipient.getUser().equals(listservAddress.getUser() + "-off")) {
                return true;
            }
        }
        return false;