{"id":14988012,"url":"https://github.com/apache/james-jspf","last_synced_at":"2025-04-13T08:19:08.149Z","repository":{"id":1920382,"uuid":"2848302","full_name":"apache/james-jspf","owner":"apache","description":"Mirror of Apache James jSPF","archived":false,"fork":false,"pushed_at":"2025-03-03T08:03:03.000Z","size":3904,"stargazers_count":22,"open_issues_count":1,"forks_count":34,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-26T21:19:06.719Z","etag":null,"topics":["james","java","mail","network-server"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.txt","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-11-25T08:00:22.000Z","updated_at":"2025-03-03T08:03:07.000Z","dependencies_parsed_at":"2024-09-19T22:01:17.562Z","dependency_job_id":"8a168dc5-0b09-432d-90a3-c0eee4d16092","html_url":"https://github.com/apache/james-jspf","commit_stats":{"total_commits":727,"total_committers":11,"mean_commits":66.0909090909091,"dds":0.5639614855570839,"last_synced_commit":"aecb8422ea88165daed55bc224f4cea68d18e454"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fjames-jspf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fjames-jspf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fjames-jspf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fjames-jspf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/james-jspf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245755672,"owners_count":20667027,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["james","java","mail","network-server"],"created_at":"2024-09-24T14:15:57.197Z","updated_at":"2025-03-27T00:09:50.076Z","avatar_url":"https://github.com/apache.png","language":"Java","readme":"Welcome to Apache James jSPF\n============================\n\nApache James jSPF is an Apache 2.0 licensed java library that implements the SPF specification.\n\nThere are 2 main entry points to the library:\n1) The SPFQuery command line tool\n2) The SPF class, for programmatic use\n\n\nSPFQuery\n--------\nYou need jspf library, dnsjava and log4j libraries in your classpath, then you run\n\u003e java -jar jspf-version.jar\nto get the usage.\n\n\nSPF\n---\nHere is a simple usage of the library:\n\nDefaultSPF spf = new DefaultSPF();\nSPFResult res = spf.checkSPF(\"192.168.0.1\", \"from@example.com\", \"example.com\");\nif (res.getResult().equals(SPF1Utils.FAIL_CONV)) {\n ... do something ...\n} else if (res.getResult().equals(SPF1Utils.PASS_CONV)) {\n ... something else..\n} else .....\nFurther results are:\n\nPERM_ERROR_CONV = \"error\";\nNONE_CONV = \"none\";\nTEMP_ERROR_CONV = \"temperror\";\nPASS_CONV = \"pass\";\nNEUTRAL_CONV = \"neutral\";\nFAIL_CONV = \"fail\";\nSOFTFAIL_CONV = \"softfail\";\n\n\nLinks\n-----\nhttp://www.openspf.org/ for the latest informations about SPF\nhttp://james.apache.org/jspf/ for the jSPF website, javadocs, xdocs and more.\n\n\nPlease help us make jSPF better - we appreciate any feedback you may have.\nEnjoy!\n\n\nDeveloper notes\n===============\n\n*Module Dependencies Layers*\n----------------------------\n\njSPF source code is structured in 4 layers. The topmost layer is the org.apache.james.jspf.impl\npackage and it depends on every other package in the sources.\n\nThen we have a second layer including the \"executor\" package, the \"policy\"+\"policy.local\" packages, \nthe \"parser\" package and the \"wiring\" package. \"executor\", having no dependencies in the third \nlayer could be included in both the second and the third layer. \"wiring\" does not have dependencies.\n\nThe third layer includes only the \"terms\" package. It depends on \"core\" (the fourth layer).\n\nThe fourth layer includes \"core\"+\"core.exceptions\" packages. They have no dependencies on other\npackages. Instead every other package depends on this code.\n\n*Mixed Synchronous/Asynchronous Implementation*\n-----------------------------------------------\n\njSPF born as a synchronous implementation, but soon introduced asynchronous support via dnsjnio\nasynchronous dns resolver library. The \"Continuation\" pattern has been used to support asynchronous\noperations.\n\nThe whole processing is defined by \"SPFChecker\"s. An SPFChecker is an object that takes an SPFSession and \napplies the needed transformations. Whenever a DNS lookup is needed an SPFChecker is allowed to return \na DNSLookupContinuation. A DNSLookupContinuation simply tells the executor that a given DNSRequest should  \nbe resolved and the DNSResponse should be returned to the given SPFCheckerDNSResponseListener (that in  \nturn is allowed to return DNSLookupContinuation if it needs DNS lookups). When an SPFChecker (or the \nSPFCheckerDNSResponseListener) completed the processing it will return null.\n\nThe SPFSession includes a checkers stack: A checker can also implement the SPFCheckerExceptionCatcher\ninterface to be able to intercept exceptions from the nested checkers.\nThe SPFExecutor role is to pop an SPFChecker from the SPFSession and execute it, by processing the\nDNSRequests included in the returned DNSLookupContinuations until a null is returned. If an exception\nis thrown by the current checker then the executor will poll every checker from the stack looking for\na checker implementing the SPFCheckerExceptionCatcher interface, will remove it from the stack and\nwill execute its onException method to handle the exception.\nPlease note that the SPFCheckerExceptionCatcher call wil often result in an additional exception to be\nrethrown and the executor will take care to pop the chekers looking for another catcher that will handle\nthe new exception.\n\nTerms, Policies and the Parser are all implementations of the SPFChecker interface. An SPFChecker\nimplementation can do every processing in the checkSPF method or can simply push more fine grained\nSPFCheckers to the checkers Stack in the SPFSession.\n\n*Packages*\n----------\n\ncore: includes the core classes for the jSPF library.\n\nwiring: an utility package used to \"wire\" components for the runtime. It has no dependencies.\n\nterms: depends on core and defines basic Mechanism and Modifiers (Directive) terms. The terms simply\n  implements one of the Mechanism / Modifier interfaces and contain a static property to define\n  the regular expression used to parse the term from the record. \n\nparser: the RFC4408SPF1Parser is the core class and it creates an SPF1Record by parsing the spf record.\n  the \"grammar\" is automatically created by reading the jspf.default.terms file that define the known\n  Modifiers and the known Mechanisms. At startup every modifier/mechanism is analyzed and a big\n  regexp is built to parse the records. Every time a record is parser the TermsFactory is used to\n  obtain a Service-Wired instance of the term.\n\nexecutor: an SPFExecutor (defined in the core package) is an object that process an SPFSession and \n  returns an SPFResult (when asynchronous executors are used the SPFResult returned will be a \n  FutureSPFResult). The executor \n\n---------------------\nThe Apache James team\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fjames-jspf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fjames-jspf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fjames-jspf/lists"}