Examples of PermErrorException


Examples of org.apache.james.jspf.core.exceptions.PermErrorException

            }
            // Remove Macro code so that r macro code does not clash with r the
            // reverse modifier
            replaceValue = replaceValue.substring(1);
        } else {
            throw new PermErrorException("MacroLetter not found: "+replaceValue);
        }

        // Find number of domains to use
        cellPattern = Pattern.compile("\\d+");
        cellMatcher = cellPattern.matcher(replaceValue);
        while (cellMatcher.find()) {
            domainNumber = cellMatcher.group();
            if (Integer.parseInt(domainNumber) == 0) {
                throw new PermErrorException(
                        "Digit transformer must be non-zero");
            }
        }
        // find if reversed
        cellPattern = Pattern.compile("r");
View Full Code Here

Examples of org.apache.james.jspf.core.exceptions.PermErrorException

                }
            }
        }

        if (rValue == null) {
            throw new PermErrorException("Unknown command : " + variable);

        } else {
            log.debug("Used macro: " + macro + " replaced with: " + rValue);

            return rValue;
View Full Code Here

Examples of org.apache.james.jspf.core.exceptions.PermErrorException

     * SPF-RFC Section 10.1. Processing Limits
     */
    public void increaseCurrentDepth() throws PermErrorException {
        this.currentDepth++;
        if (currentDepth > MAX_DEPTH)
            throw new PermErrorException(
                    "Maximum mechanism/modifiers calls done: "
                        + currentDepth);
    }
View Full Code Here

Examples of org.apache.james.jspf.core.exceptions.PermErrorException

                for (int i = 0; i < bytes.length / 2; i++) {
                    address[i] = unsigned(bytes[i * 2]) * 256
                            + unsigned(bytes[i * 2 + 1]);
                }
            } else {
                throw new PermErrorException("Not a valid address: " + netAddress);
            }
        } catch (NumberFormatException e) {
            throw new PermErrorException("Not a valid address: " + netAddress);
        }
    }
View Full Code Here

Examples of org.apache.james.jspf.core.exceptions.PermErrorException

     *             if the ipAddress is not valid (rfc conform)
     */
    public static String getInAddress(String ipAddress)
            throws PermErrorException {
        if (ipAddress == null) {
            throw new PermErrorException(
                    "IP is not a valid ipv4 or ipv6 address");
        } else if (Inet6Util.isValidIPV4Address(ipAddress)) {
            return "in-addr";
        } else if (Inet6Util.isValidIP6Address(ipAddress)) {
            return "ip6";
        } else {
            throw new PermErrorException(
                    "IP is not a valid ipv4 or ipv6 address");
        }
    }
View Full Code Here

Examples of org.apache.james.jspf.core.exceptions.PermErrorException

    public static String getProperIpAddress(String ip) throws PermErrorException {
        if (isIPV6(ip) && isIPV4MappedIP(ip)) {
            try {
                return getConvertedIP(ip);
            } catch (UnknownHostException e) {
                throw new PermErrorException("Invalid ipAddress: " + ip);
            }
        }
        return ip;
       
    }
View Full Code Here

Examples of org.apache.james.jspf.core.exceptions.PermErrorException

            // We trim the compare value only for the comparison
            if (compare.toLowerCase().trim().startsWith(SPF1Constants.SPF_VERSION1 + " ") || compare.trim().equalsIgnoreCase(SPF1Constants.SPF_VERSION1)) {
                if (returnValue == null) {
                    returnValue = compare;
                } else {
                    throw new PermErrorException(
                            "More than 1 SPF record found");
                }
            }
        }
       
View Full Code Here

Examples of org.apache.james.jspf.core.exceptions.PermErrorException

    public synchronized void config(Configuration params) throws PermErrorException {
        super.config(params);
        if (params.groupCount() >= 2 && params.group(2) != null) {
            ip4cidr = Integer.parseInt(params.group(2));
            if (ip4cidr > 32) {
                throw new PermErrorException("Ivalid IP4 CIDR length");
            }
        } else {
            ip4cidr = 32;
        }
        if (params.groupCount() >= 3 && params.group(3) != null) {
            ip6cidr = Integer.parseInt(params.group(3).toString());
            if (ip6cidr > 128) {
                throw new PermErrorException("Ivalid IP6 CIDR length");
            }
        } else {
            ip6cidr = 128;
        }
    }
View Full Code Here

Examples of org.apache.james.jspf.core.exceptions.PermErrorException

                }
            // PermError / TempError
            // TODO: Should we replace this with the "right" Exceptions ?
            } catch (Exception e) {
                log.debug("No valid ipAddress: ",e);
                throw new PermErrorException("No valid ipAddress: "
                        + spfData.getIpAddress());
            }
           
        }
View Full Code Here

Examples of org.apache.james.jspf.core.exceptions.PermErrorException

            return spfR1;
        } else if (spfR1 == null && spfR2 != null) {
            return spfR2;
        } else if (spfR1 != null && spfR2 != null) {
            if (spfR1.toLowerCase().equals(spfR2.toLowerCase()) == false) {
                throw new PermErrorException("Published SPF records not equals");
            } else {
                return spfR1;
            }
        } else {
            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.