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

CommandListservMatcher

public class CommandListservMatcher extends org.apache.mailet.GenericRecipientMatcher
CommandListservMatcher is the matcher that pairs with the {@link org.apache.james.transport.mailets.CommandListservManager} It checks to see if the request is intended for the ListservManager, but doesn't guarantee that it is a valid command.
To configure, insert this into the config.xml inside of the root processor block.
<mailet match="CommandListservMatcher=announce@localhost" class="CommandListservManager">
...
</mailet>
version
CVS $Revision: 494012 $ $Date: 2007-01-08 11:23:58 +0100 (Mo, 08 Jan 2007) $
since
2.2.0
see
org.apache.james.transport.mailets.CommandListservManager

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)
This doesn't perform an exact match, but checks to see if the request is at lesast intended to go to the list serv manager.

param
recipient
return
true if matches, false otherwise

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