On Tue, 16 Oct 2001, Jim Scott wrote:
> I have been monitoring the conversation about valid local users and SMTP.
> Having a RecipientIsLocal matcher would be great. I have considered writing
> one, as have several others, but I have been procrastinating to see what
> others had done.
Well, Serge has done it long ago.
package org.apache.james.transport.matchers;
import org.apache.mailet.*;
import java.util.*;
/**
* @version 1.0.0, 24/04/1999
* @author Federico Barbieri <[EMAIL PROTECTED]>
* @author Serge Knystautas <[EMAIL PROTECTED]>
*/
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());
}
}
Oki
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]