Package org.apache.james.jspf.core.exceptions

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


        // check the version "header"
        if (spfRecord.toLowerCase().startsWith(SPF1Constants.SPF_VERSION1 + " ") || spfRecord.equalsIgnoreCase(SPF1Constants.SPF_VERSION1)) {
            if (!spfRecord.toLowerCase().startsWith(SPF1Constants.SPF_VERSION1 + " ")) throw new NeutralException("Empty SPF Record");
        } else {
            throw new NoneException("No valid SPF Record: " + spfRecord);
        }

        // extract terms
        String[] terms = termsSeparatorPattern.split(spfRecord.replaceFirst(
                SPF1Constants.SPF_VERSION1, ""));
View Full Code Here


    public DNSRequest(final String hostname, final int recordType) throws NoneException {
        if (recordType == MX || recordType == A || recordType == AAAA) {
            try {
                Name.fromString(hostname);
            } catch (TextParseException e) {
                throw new NoneException(e.getMessage());
            }
        }
        this.hostname = hostname;
        this.recordType = recordType;
    }
View Full Code Here

    /**
     * @see org.apache.james.jspf.policies.PolicyPostFilter#getSPFRecord(java.lang.String, org.apache.james.jspf.core.SPF1Record)
     */
    public SPF1Record getSPFRecord(String currentDomain, SPF1Record res) throws PermErrorException, TempErrorException, NoneException, NeutralException {
        if (res == null) {
            throw new NoneException("No SPF record found for host: " + currentDomain);
        } else {
            return res;
        }
    }
View Full Code Here

            String currentDomain = spfData.getCurrentDomain();
            if (currentDomain != null) {
                String[] labels = currentDomain.split("\\.");
                for (int i = 0; i < labels.length; i++) {
                    if (labels[i] != null && labels[i].length() > 63) {
                        throw new NoneException("Domain "+currentDomain+" is malformed (label longer than 63 characters)");
                    }
                }
            }
           
            if (spfData.getSenderDomain().indexOf('.') < 0) {
                throw new NoneException("Sender domain "+spfData.getSenderDomain()+" is not an FQDN.");
            }
           
            try {
                Name.fromString(spfData.getSenderDomain());
            } catch (TextParseException e) {
                throw new NoneException("Invalid sender domain: "+e.getMessage());
            }
        }
        return null;
    }
View Full Code Here

        } else {
            String[] fromParts = mailFrom.split("@");

            // should never be bigger as 2 !
            if (fromParts.length > 2) {
                throw new NoneException("Not a valid email address " + mailFrom);
            } else if (fromParts.length == 2) {
                this.currentSenderPart = fromParts[0];
                this.senderDomain = fromParts[1];
            } else {
                this.currentSenderPart = "postmaster";
View Full Code Here

        // check the version "header"
        if (spfRecord.toLowerCase().startsWith(SPF1Constants.SPF_VERSION1 + " ") || spfRecord.equalsIgnoreCase(SPF1Constants.SPF_VERSION1)) {
            if (!spfRecord.toLowerCase().startsWith(SPF1Constants.SPF_VERSION1 + " ")) throw new NeutralException("Empty SPF Record");
        } else {
            throw new NoneException("No valid SPF Record: " + spfRecord);
        }

        // extract terms
        String[] terms = termsSeparatorPattern.split(spfRecord.replaceFirst(
                SPF1Constants.SPF_VERSION1, ""));
View Full Code Here

TOP

Related Classes of org.apache.james.jspf.core.exceptions.NoneException

Copyright © 2018 www.massapicom. 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.