Package org.apache.james.transport.matchers

Source Code of org.apache.james.transport.matchers.RecipientIsLocal

/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE file.
*/
package org.apache.james.transport.matchers;

import org.apache.mailet.GenericRecipientMatcher;
import org.apache.mailet.MailAddress;
import org.apache.mailet.MailetContext;

/**
* @version 1.0.0, 24/04/1999
* @author Federico Barbieri <scoobie@pop.systemy.it>
* @author Serge Knystautas <sergek@lokitech.com>
*/
public class RecipientIsLocal extends GenericRecipientMatcher {

    public boolean matchRecipient(MailAddress recipient) {
        MailetContext mailetContext = getMailetContext();
        //This might change after startup
        return mailetContext.isLocalServer(recipient.getHost().toLowerCase())
            && mailetContext.isLocalUser(recipient.getUser());
    }
}
TOP

Related Classes of org.apache.james.transport.matchers.RecipientIsLocal

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.