All pastes #404505 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-03-21 01:52 UTC
rendered paste body
    public boolean filter(Packet p) {

        String fromDomain = p.getFrom().getDomain();
        String toDomain = p.getTo().getDomain();
        Boolean toMatch = false;
        Boolean fromMatch = false;

        for (String allowedDomain : allowedDomains) {
                if (fromDomain.equalsIgnoreCase(allowedDomain) {
                        fromMath = true;
                }
                if (toDomain.equalsIgnoreCase(allowedDomain) {
                        toMatch = true;
                }
        }

        if (fromMatch && toMatch) {
                return false;
        } else {
                return process(p.getElement());
        }
    }