Examples of IPAddr


Examples of org.apache.james.jspf.core.IPAddr

        // Get the right host.
        String host = expandHost(spfData);

        try {
            // Get PTR Records for the ipAddress which is provided by SPF1Data
            IPAddr ip = IPAddr.getAddress(spfData.getIpAddress());
            List domainList = dnsService.getRecords(ip.getReverseIP(), DNSService.PTR);
   
            // No PTR records found
            if (domainList == null) return false;
   
            // check if the maximum lookup count is reached
View Full Code Here

Examples of org.apache.james.jspf.core.IPAddr

     * @throws NoneException
     * @see org.apache.james.jspf.core.GenericMechanism#run(org.apache.james.jspf.core.SPF1Data)
     */
    public boolean run(SPF1Data spfData) throws PermErrorException,
            TempErrorException{
        IPAddr checkAddress;

        // update currentDepth
        spfData.increaseCurrentDepth();

        // Get the right host.
View Full Code Here

Examples of org.apache.james.jspf.core.IPAddr

        // get the ipAddress
        try {
            if (Inet6Util.isValidIPV4Address(spfData.getIpAddress())) {

                IPAddr checkAddress = IPAddr.getAddress(spfData.getIpAddress(),
                        getIp4cidr());

                List aRecords = getARecords(dnsService,host);
    
                // no a records just return null
                if (aRecords == null) {
                    return false;
                }

                if (checkAddressList(checkAddress, aRecords, getIp4cidr())) {
                    return true;
                }
            } else {
                IPAddr checkAddress = IPAddr.getAddress(spfData.getIpAddress(),
                        getIp6cidr());

                List aaaaRecords = getAAAARecords(dnsService, host);
               
                // no aaaa records just return false
View Full Code Here

Examples of org.apache.james.jspf.core.IPAddr

            // Check for empty record
            if (ip != null) {
                // set the mask in the address.
                // TODO should we use cidr from the parameters or the input checkAddress cidr?
                IPAddr ipAddr = IPAddr.getAddress(ip, checkAddress.getMaskLength());
                if (checkAddress.getMaskedIPAddress().equals(
                        ipAddr.getMaskedIPAddress())) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

Examples of org.apache.james.jspf.core.IPAddr

     */
    public List getAAAARecords(DNSService dns, String strServer)
            throws PermErrorException, TempErrorException {
        List listAAAAData;
        if (IPAddr.isIPAddr(strServer)) {
            IPAddr ipTest = IPAddr.getAddress(strServer);
            // Address is already an IP address, so add it to list
            listAAAAData = new ArrayList();
            listAAAAData.add(ipTest);
        } else {
            try {
View Full Code Here

Examples of org.apache.james.jspf.core.IPAddr

    /**
     *
     * @see org.apache.james.jspf.core.GenericMechanism#run(org.apache.james.jspf.core.SPF1Data)
     */
    public boolean run(SPF1Data spfData) throws PermErrorException {
        IPAddr originalIP;

        originalIP = IPAddr.getAddress(spfData.getIpAddress(), getIp()
                .getMaskLength());

        if (getIp().getMaskedIPAddress().equals(originalIP.getMaskedIPAddress())) {
            return true;
        } else {
            // No match
            return false;
        }
View Full Code Here

Examples of org.apache.james.jspf.core.IPAddr

         */
        public DNSLookupContinuation checkSPF(SPFSession spfData) throws PermErrorException,
                TempErrorException, NeutralException, NoneException {

            // Get PTR Records for the ipAddress which is provided by SPF1Data
            IPAddr ip = IPAddr.getAddress(spfData.getIpAddress());

            // Get the right host.
            String host = expandHost(spfData);
           
            spfData.setAttribute(ATTRIBUTE_EXPANDED_HOST, host);
           
            spfData.pushChecker(cleanupChecker);

            return new DNSLookupContinuation(new DNSRequest(ip.getReverseIP(), DNSRequest.PTR), PTRMechanism.this);
        }
View Full Code Here

Examples of org.apache.james.jspf.core.IPAddr

                spfSession.setAttribute(Directive.ATTRIBUTE_MECHANISM_RESULT, Boolean.FALSE);
                return null;
            }

            // get the ipAddress
            IPAddr checkAddress;
            checkAddress = IPAddr.getAddress(spfSession.getIpAddress(), isIPv6 ? getIp6cidr() : getIp4cidr());
           
            // clean up attributes
            spfSession.removeAttribute(ATTRIBUTE_CHECK_RECORDS);
            spfSession.removeAttribute(ATTRIBUTE_MX_RECORDS);
View Full Code Here

Examples of org.apache.james.jspf.core.IPAddr

            // Check for empty record
            if (ip != null) {
                // set the mask in the address.
                // TODO should we use cidr from the parameters or the input checkAddress cidr?
                IPAddr ipAddr = IPAddr.getAddress(ip, checkAddress.getMaskLength());
                if (checkAddress.getMaskedIPAddress().equals(
                        ipAddr.getMaskedIPAddress())) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

Examples of org.apache.james.jspf.core.IPAddr

        }

        Boolean ipv4check = (Boolean) spfSession.getAttribute(ATTRIBUTE_AMECHANISM_IPV4CHECK);
        if (ipv4check.booleanValue()) {

            IPAddr checkAddress = IPAddr.getAddress(spfSession.getIpAddress(),
                    getIp4cidr());

            if (checkAddressList(checkAddress, listAData, getIp4cidr())) {
                spfSession.setAttribute(Directive.ATTRIBUTE_MECHANISM_RESULT, Boolean.TRUE);
                return null;
            }

        } else {

            IPAddr checkAddress = IPAddr.getAddress(spfSession.getIpAddress(),
                    getIp6cidr());
           
            if (checkAddressList(checkAddress, listAData, getIp6cidr())) {
                spfSession.setAttribute(Directive.ATTRIBUTE_MECHANISM_RESULT, Boolean.TRUE);
                return null;
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.