Examples of NetMatcher


Examples of org.apache.james.dnsservice.library.netmatcher.NetMatcher

            java.util.Collection<String> networks = new java.util.ArrayList<String>();
            while (st.hasMoreTokens()) {
                String addr = st.nextToken();
                networks.add(addr);
            }
            authorizedNetworks = new NetMatcher(networks, dns);
        }
        SMTPProtocol transport = new SMTPProtocol(getProtocolHandlerChain(), theConfigData, new ProtocolLoggerAdapter(getLogger())) {

            @Override
            public ProtocolSession newSession(ProtocolTransport transport) {
View Full Code Here

Examples of org.apache.james.dnsservice.library.netmatcher.NetMatcher

            selectRS = selectStmt.executeQuery();
            List<String> nets = new ArrayList<String>();
            while (selectRS.next()) {
                nets.add(selectRS.getString(1));
            }
            NetMatcher matcher = new NetMatcher(nets, dns);
            boolean matched = matcher.matchInetNetwork(mail.getRemoteAddr());

            if (!matched) {
                selectStmt = conn.prepareStatement(selectNetworks);
                selectStmt.setString(1, "*");
                selectStmt.setString(2, recipientHost);
                selectRS = selectStmt.executeQuery();
                nets = new ArrayList<String>();
                while (selectRS.next()) {
                    nets.add(selectRS.getString(1));
                }
                matcher = new NetMatcher(nets, dns);
                matched = matcher.matchInetNetwork(mail.getRemoteAddr());
            }
            return matched;
        } catch (SQLException sqle) {
            log("Error accessing database", sqle);
            throw new MessagingException("Exception thrown", sqle);
View Full Code Here

Examples of org.apache.james.dnsservice.library.netmatcher.NetMatcher

    public void init() throws MessagingException {

        Collection<String> nets = allowedNetworks();

        if (nets != null) {
            authorizedNetworks = new NetMatcher(allowedNetworks(), dnsServer) {
                protected void log(String s) {
                    AbstractNetworkMatcher.this.log(s);
                }
            };
            log("Authorized addresses: " + authorizedNetworks.toString());
View Full Code Here

Examples of org.apache.james.dnsservice.library.netmatcher.NetMatcher

            String[] whitelistArray = nets.split(",");
            List<String> wList = new ArrayList<String>(whitelistArray.length);
            for (String aWhitelistArray : whitelistArray) {
                wList.add(aWhitelistArray.trim());
            }
            setWhiteListedNetworks(new NetMatcher(wList, dnsService));
            serviceLog.info("Whitelisted addresses: " + getWhiteListedNetworks().toString());

        }

        // Get the SQL file location
View Full Code Here

Examples of org.apache.james.dnsservice.library.netmatcher.NetMatcher

     *
     * @param networks  Collection of networks
     * @param dnsServer The DNSServer
     */
    public void setBannedNetworks(Collection<String> networks, DNSService dnsServer) {
        bNetwork = new NetMatcher(networks, dnsServer) {
            protected void log(String s) {
                serviceLog.debug(s);
            }
        };
    }
View Full Code Here

Examples of org.apache.james.util.NetMatcher

    private NetMatcher authorizedNetworks = null;

    public void init() throws MessagingException {
        Collection nets = allowedNetworks();
        if (nets != null) {
            authorizedNetworks = new NetMatcher() {
                protected void log(String s) {
                    AbstractNetworkMatcher.this.log(s);
                }
            };
            authorizedNetworks.initInetNetworks(allowedNetworks());
View Full Code Here

Examples of org.apache.james.util.NetMatcher

                java.util.Collection networks = new java.util.ArrayList();
                while (st.hasMoreTokens()) {
                    String addr = st.nextToken();
                    networks.add(addr);
                }
                authorizedNetworks = new NetMatcher(networks);
            }

            if (authorizedNetworks != null) {
                getLogger().info("Authorized addresses: " + authorizedNetworks.toString());
            }
View Full Code Here

Examples of org.apache.james.util.NetMatcher

                java.util.Collection networks = new java.util.ArrayList();
                while (st.hasMoreTokens()) {
                    String addr = st.nextToken();
                    networks.add(addr);
                }
                authorizedNetworks = new NetMatcher(networks);
            }

            if (authorizedNetworks != null) {
                getLogger().info("Authorized addresses: " + authorizedNetworks.toString());
            }
View Full Code Here

Examples of org.apache.james.util.NetMatcher

    private NetMatcher authorizedNetworks = null;

    public void init() throws MessagingException {
        Collection nets = allowedNetworks();
        if (nets != null) {
            authorizedNetworks = new NetMatcher() {
                protected void log(String s) {
                    AbstractNetworkMatcher.this.log(s);
                }
            };
            authorizedNetworks.initInetNetworks(allowedNetworks());
View Full Code Here

Examples of org.apache.james.util.NetMatcher

    private NetMatcher authorizedNetworks = null;

    public void init() throws MessagingException {
        Collection nets = allowedNetworks();
        if (nets != null) {
            authorizedNetworks = new NetMatcher() {
                protected void log(String s) {
                    AbstractNetworkMatcher.this.log(s);
                }
            };
            authorizedNetworks.initInetNetworks(allowedNetworks());
View Full Code Here
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.