Package org.apache.james.jspf.core

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


     * @throws NeutralException exception
     */
    public void checkSPF(SPF1Data spfData, SPF1Record spfRecord) throws PermErrorException, NoneException, TempErrorException, NeutralException {
        Iterator i = spfRecord.iterator();
        while (i.hasNext()) {
            SPFChecker m = (SPFChecker) i.next();

            m.checkSPF(spfData);

        }
    }
View Full Code Here


     */
    protected SPF1Record getSPFRecordPostFilter(String currentDomain, SPF1Record spfRecord) throws PermErrorException, TempErrorException, NoneException, NeutralException {
        // Set the result to NEUTRAL if at least a directive is present and it didn't match
        // Maybe we should simply append a "?all" at the end, as modifier
        if (spfRecord.getDirectives().size() > 0) {
            spfRecord.getModifiers().add(new SPFChecker() {
                public void checkSPF(SPF1Data spfData) throws PermErrorException, NoneException, TempErrorException, NeutralException {
                    // If no match was found set the result to neutral
                    if (spfData.getCurrentResult() == null) {
                        spfData.setCurrentResult(SPF1Constants.NEUTRAL);
                    }
View Full Code Here

    /**
     * @see org.apache.james.jspf.policies.AbstractNestedPolicy#getSPFRecordPostFilter(java.lang.String, org.apache.james.jspf.core.SPF1Record)
     */
    protected SPF1Record getSPFRecordPostFilter(String currentDomain, SPF1Record spfRecord) throws PermErrorException, TempErrorException, NoneException, NeutralException {
        // Default explanation policy
        spfRecord.getModifiers().add(new SPFChecker() {
            public void checkSPF(SPF1Data spfData) throws PermErrorException, NoneException, TempErrorException, NeutralException {
               
                if (SPF1Constants.FAIL.equals(spfData.getCurrentResult())) { 
                    if (spfData.getExplanation()==null || spfData.getExplanation().equals("")) {
                        String explanation;
View Full Code Here

        // Setup the data
        spfData = new SPFSession(mailFrom, hostName, ipAddress);
     

        SPFChecker resultHandler = new DefaultSPFChecker(log);
       
        spfData.pushChecker(resultHandler);
        spfData.pushChecker(this);
       
        FutureSPFResult ret = new FutureSPFResult();
View Full Code Here

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

        // if we already have a result we don't need to add further processing.
        if (spfData.getCurrentResultExpanded() == null && spfData.getCurrentResult() == null) {
            SPFChecker policyChecker = new PolicyChecker(getPolicies());
            SPFChecker recordChecker = new SPFRecordChecker();
           
            spfData.pushChecker(recordChecker);
            spfData.pushChecker(policyChecker);
        }
       
View Full Code Here

           
            LinkedList policyCheckers = new LinkedList();
           
            Iterator i = spfRecord.iterator();
            while (i.hasNext()) {
                SPFChecker checker = (SPFChecker) i.next();
                policyCheckers.add(checker);
            }

            while (policyCheckers.size() > 0) {
                SPFChecker removeLast = (SPFChecker) policyCheckers.removeLast();
                spfData.pushChecker(removeLast);
            }

            return null;
        }
View Full Code Here

        public DNSLookupContinuation checkSPF(SPFSession spfData)
                throws PermErrorException, TempErrorException,
                NeutralException, NoneException {
           
            while (policies.size() > 0) {
                SPFChecker removeLast = (SPFChecker) policies.removeLast();
                spfData.pushChecker(removeLast);
            }
           
            return null;
        }
View Full Code Here

    public void execute(SPFSession session, FutureSPFResult result) {
        execute(session, result, true);
    }
       
    public void execute(SPFSession session, FutureSPFResult result, boolean throttle) {
        SPFChecker checker;
        while ((checker = session.popChecker()) != null) {
            // only execute checkers we added (better recursivity)
            log.debug("Executing checker: " + checker);
            try {
                DNSLookupContinuation cont = checker.checkSPF(session);
                // if the checker returns a continuation we return it
                if (cont != null) {
                    invokeAsynchService(session, result, cont, throttle);
                    return;
                }
View Full Code Here

                } else {
                    execute(session, result, false);
                }

            } catch (Exception e) {
                SPFChecker checker = null;
                while (e != null) {
                    while (checker == null || !(checker instanceof SPFCheckerExceptionCatcher)) {
                        checker = session.popChecker();
                    }
                    try {
View Full Code Here

        // Setup the data
        spfData = new SPFSession(mailFrom, hostName, ipAddress);
     

        SPFChecker resultHandler = new DefaultSPFChecker(log);
       
        spfData.pushChecker(resultHandler);
        spfData.pushChecker(this);
       
        FutureSPFResult ret = new FutureSPFResult();
View Full Code Here

TOP

Related Classes of org.apache.james.jspf.core.SPFChecker

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.