james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r452249 - in /james/jspf/trunk/src/main/java/org/apache/james/jspf: SPF.java SPFQuery.java
Date Mon, 02 Oct 2006 22:41:52 GMT
Author: norman
Date: Mon Oct  2 15:41:52 2006
New Revision: 452249

URL: http://svn.apache.org/viewvc?view=rev&rev=452249
Log:
Add support of trusted-forwarder.org to SPFQuery. See JSPF-30

Modified:
    james/jspf/trunk/src/main/java/org/apache/james/jspf/SPF.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/SPFQuery.java

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/SPF.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/SPF.java?view=diff&rev=452249&r1=452248&r2=452249
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/SPF.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/SPF.java Mon Oct  2 15:41:52 2006
@@ -424,7 +424,7 @@
      * 
      * @param useTrustedForwarder true or false
      */
-    public synchronized void useTrustedForwarder(boolean useTrustedForwarder) {
+    public synchronized void setUseTrustedForwarder(boolean useTrustedForwarder) {
         this.useTrustedForwarder = useTrustedForwarder;
     }
 }

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/SPFQuery.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/SPFQuery.java?view=diff&rev=452249&r1=452248&r2=452249
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/SPFQuery.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/SPFQuery.java Mon Oct  2 15:41:52
2006
@@ -65,6 +65,8 @@
     private final static String CMD_DEFAULT_EXP = "defaultexplanation";
 
     private final static String CMD_BEST_GUESS = "usebestguess";
+    
+    private final static String CMD_TRUSTED_FORWARDER = "usetrusted";
 
     private static Logger logger = Logger.getRootLogger();
 
@@ -79,6 +81,7 @@
         String helo = null;
         String defaultExplanation = null;
         boolean useBestGuess = false;
+        boolean useTrustedForwarder = false;
 
         SimpleLayout layout = new SimpleLayout();
         ConsoleAppender consoleAppender = new ConsoleAppender(layout);
@@ -97,7 +100,7 @@
             helo = line.getOptionValue(CMD_HELO);
             defaultExplanation = line.getOptionValue(CMD_DEFAULT_EXP);
             useBestGuess = line.hasOption(CMD_BEST_GUESS);
-
+            useTrustedForwarder = line.hasOption(CMD_TRUSTED_FORWARDER);
             // check if all needed values was set
             if (ip != null && sender != null && helo != null) {
 
@@ -117,6 +120,10 @@
                 if (useBestGuess == true) {
                     spf.setUseBestGuess(true);
                 }
+                
+                if (useTrustedForwarder == true) {
+                    spf.setUseTrustedForwarder(true);
+                }
 
                 SPFResult result = spf.checkSPF(ip, sender, helo);
                 System.out.println(result.getResult());
@@ -147,6 +154,7 @@
         options.addOption(OptionBuilder.withLongOpt(CMD_DEFAULT_EXP)
                 .withValueSeparator('=').hasArg().create());
         options.addOption(OptionBuilder.withLongOpt(CMD_BEST_GUESS).create());
+        options.addOption(OptionBuilder.withLongOpt(CMD_TRUSTED_FORWARDER).create());
         options.addOption(OptionBuilder.withLongOpt(CMD_DEBUG).create());
         options.addOption(OptionBuilder.withLongOpt(CMD_VERBOSE).create());
         return options;
@@ -160,7 +168,7 @@
         System.out.println("Usage: java -jar jspf-x.jar --" + CMD_IP
                 + "=192.168.100.1 --" + CMD_SENDER + "=postmaster@foo.bar --"
                 + CMD_HELO + "=foo.bar [--" + CMD_DEFAULT_EXP
-                + "=\"explanation String\"] [--" + CMD_BEST_GUESS + "] "
+                + "=\"explanation String\"] [--" + CMD_BEST_GUESS + "] [--"+ CMD_TRUSTED_FORWARDER
+"]"
                 + CMD_DEBUG + "] [--" + CMD_VERBOSE + "]");
         System.exit(UNKNOWN_RCODE);
     }



---------------------------------------------------------------------
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