james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r572294 - /james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/SPFRetriever.java
Date Mon, 03 Sep 2007 12:39:51 GMT
Author: bago
Date: Mon Sep  3 05:39:50 2007
New Revision: 572294

URL: http://svn.apache.org/viewvc?rev=572294&view=rev
Log:
Minor change to SPFRetriever: added a constant to switch from SPF+TXT resolution to TXT only
(rarely useful when testing fallback behaviour)

Modified:
    james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/SPFRetriever.java

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/SPFRetriever.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/SPFRetriever.java?rev=572294&r1=572293&r2=572294&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/SPFRetriever.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/SPFRetriever.java Mon Sep
 3 05:39:50 2007
@@ -85,6 +85,12 @@
         }
         
     }
+
+		/**
+		 * This is used for testing purpose. Setting this to true will skip the initial
+		 * lookups for SPF records and instead will simply check the TXT records.
+		 */
+		private static final boolean CHECK_ONLY_TXT_RECORDS = false;
     
     /**
      * Return the extracted SPF-Record 
@@ -136,8 +142,11 @@
         SPF1Record res = (SPF1Record) spfData.getAttribute(SPF.ATTRIBUTE_SPF1_RECORD);
         if (res == null) {
             String currentDomain = spfData.getCurrentDomain();
-
-            return new DNSLookupContinuation(new DNSRequest(currentDomain, DNSRequest.SPF),
new SPFRetrieverDNSResponseListener());
+            if (CHECK_ONLY_TXT_RECORDS) {
+                return new DNSLookupContinuation(new DNSRequest(currentDomain, DNSRequest.TXT),
new SPFRecordHandlerDNSResponseListener());
+            } else {
+                return new DNSLookupContinuation(new DNSRequest(currentDomain, DNSRequest.SPF),
new SPFRetrieverDNSResponseListener());
+            }
             
         }
         return null;



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message