@@ -0,0 +1,3026 @@
+/***********************************************************************%0A * Copyright (c) 2006 The Apache Software Foundation.                  *%0A * All rights reserved.                                                *%0A * ------------------------------------------------------------------- *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22); you *%0A * may not use this file except in compliance with the License. You    *%0A * may obtain a copy of the License at:                                *%0A *                                                                     *%0A *     http://www.apache.org/licenses/LICENSE-2.0                      *%0A *                                                                     *%0A * Unless required by applicable law or agreed to in writing, software *%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,   *%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     *%0A * implied.  See the License for the specific language governing       *%0A * permissions and limitations under the License.                      *%0A ***********************************************************************/%0A%0Apackage org.apache.james.jspf;%0A%0A/**%0A * This class is used for commandline usage of JSPF%0A * %0A * @author Norman Maurer %3Cnm@byteaction.de%3E%0A * @author Stefano Bagnara %3Capache@bago.org%3E%0A */%0Apublic class SPFQuery %7B%0A%0A    /**%0A     * @param args%0A     *            The commandline arguments to parse%0A     */%0A    public static void main(String%5B%5D args) %7B%0A        String ip = null;%0A        String sender = null;%0A        String helo = null;%0A%0A        // Parse the command line arguments%0A        if (args.length %3C 3) %7B%0A            usage();%0A        %7D else %7B%0A            for (int i = 0; i %3C args.length; i++) %7B%0A                String%5B%5D arguments = args%5Bi%5D.split(%22=%22);%0A                if (arguments.length == 2) %7B%0A                    if (arguments%5B0%5D.equals(%22-ip%22)) %7B%0A                        ip = arguments%5B1%5D;%0A                    %7D else if (arguments%5B0%5D.equals(%22-sender%22)) %7B%0A                        sender = arguments%5B1%5D;%0A                    %7D else if (arguments%5B0%5D.equals(%22-helo%22)) %7B%0A                        helo = arguments%5B1%5D;%0A                    %7D else %7B%0A                        usage();%0A                    %7D%0A                %7D else %7B%0A                    usage();%0A                %7D%0A%0A            %7D%0A%0A            // check if all needed values was set%0A            if (ip != null && sender != null && helo != null) %7B%0A                SPF spf = new SPF();%0A                SPFResult result = spf.checkSPF(ip, sender, helo);%0A                System.out.println(result.getResult());%0A                System.out.println(result.getHeader());%0A                System.exit(0);%0A            %7D else %7B%0A                usage();%0A            %7D%0A        %7D%0A    %7D%0A%0A    /**%0A     * Print out the usage%0A     */%0A    private static void usage() %7B%0A        System.out%0A                .println(%22Usage: SPFQuery -ip=192.168.100.1 -sender=postmaster@foo.bar -helo=foo.bar%22);%0A        System.exit(0);%0A    %7D%0A%0A%7D%0A

Add new class for commandline usage. See JSPF-13