This is an automated email from the ASF dual-hosted git repository.

rcordier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-jspf.git


The following commit(s) were added to refs/heads/master by this push:
     new af62651  Allowed the SPFSession to talk about itself.
af62651 is described below

commit af62651c9b5926c3b4482a57bd1e3949f642c127
Author: Aleksey Mishanin <a.misha...@adguard.com>
AuthorDate: Mon Jun 3 20:41:44 2024 +0300

    Allowed the SPFSession to talk about itself.
---
 .../org/apache/james/jspf/core/SPFSession.java     | 22 ++++++++++++++++++++++
 .../jspf/executor/AsynchronousSPFExecutor.java     |  2 +-
 .../jspf/executor/StagedMultipleSPFExecutor.java   |  2 +-
 .../jspf/executor/SynchronousSPFExecutor.java      |  2 +-
 4 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/resolver/src/main/java/org/apache/james/jspf/core/SPFSession.java 
b/resolver/src/main/java/org/apache/james/jspf/core/SPFSession.java
index 90651a7..a6672e8 100644
--- a/resolver/src/main/java/org/apache/james/jspf/core/SPFSession.java
+++ b/resolver/src/main/java/org/apache/james/jspf/core/SPFSession.java
@@ -400,4 +400,26 @@ public class SPFSession implements MacroData {
         return currentResultExpanded;
     }
 
+    @Override
+    public String toString() {
+        return "SPFSession{" +
+               "ipAddress='" + ipAddress + '\'' +
+               ", mailFrom='" + mailFrom + '\'' +
+               ", hostName='" + hostName + '\'' +
+               ", currentSenderPart='" + currentSenderPart + '\'' +
+               ", currentDomain='" + currentDomain + '\'' +
+               ", inAddress='" + inAddress + '\'' +
+               ", clientDomain='" + clientDomain + '\'' +
+               ", senderDomain='" + senderDomain + '\'' +
+               ", readableIP='" + readableIP + '\'' +
+               ", receivingDomain='" + receivingDomain + '\'' +
+               ", currentDepth=" + currentDepth +
+               ", explanation='" + explanation + '\'' +
+               ", currentResult='" + currentResult + '\'' +
+               ", ignoreExplanation=" + ignoreExplanation +
+               ", attributes=" + attributes +
+               ", checkers=" + checkers +
+               ", currentResultExpanded='" + currentResultExpanded + '\'' +
+               '}';
+    }
 }
\ No newline at end of file
diff --git 
a/resolver/src/main/java/org/apache/james/jspf/executor/AsynchronousSPFExecutor.java
 
b/resolver/src/main/java/org/apache/james/jspf/executor/AsynchronousSPFExecutor.java
index 4e8d971..2aee4ce 100644
--- 
a/resolver/src/main/java/org/apache/james/jspf/executor/AsynchronousSPFExecutor.java
+++ 
b/resolver/src/main/java/org/apache/james/jspf/executor/AsynchronousSPFExecutor.java
@@ -106,7 +106,7 @@ public class AsynchronousSPFExecutor implements SPFExecutor 
{
             checker = session.popChecker(c -> c instanceof 
SPFCheckerExceptionCatcher);
             if (checker == null) {
                 // Error case not handled by JSPF. Throw to avoid infinite 
loop. See JSPF-110.
-                throw new RuntimeException(e);
+                throw new RuntimeException("SPFCheckerExceptionCatcher 
implementation not found, session: " + session, e);
             }
             try {
                 ((SPFCheckerExceptionCatcher) checker).onException(e, session);
diff --git 
a/resolver/src/main/java/org/apache/james/jspf/executor/StagedMultipleSPFExecutor.java
 
b/resolver/src/main/java/org/apache/james/jspf/executor/StagedMultipleSPFExecutor.java
index 47f597d..17fe7a7 100644
--- 
a/resolver/src/main/java/org/apache/james/jspf/executor/StagedMultipleSPFExecutor.java
+++ 
b/resolver/src/main/java/org/apache/james/jspf/executor/StagedMultipleSPFExecutor.java
@@ -131,7 +131,7 @@ public class StagedMultipleSPFExecutor implements 
SPFExecutor, Runnable {
                     checker = session.popChecker(c -> c instanceof 
SPFCheckerExceptionCatcher);
                     if (checker == null) {
                         // Error case not handled by JSPF. Throw to avoid 
infinite loop. See JSPF-110.
-                        throw new RuntimeException(e);
+                        throw new RuntimeException("SPFCheckerExceptionCatcher 
implementation not found, session: " + session, e);
                     }
                     try {
                         ((SPFCheckerExceptionCatcher) checker).onException(e, 
session);
diff --git 
a/resolver/src/main/java/org/apache/james/jspf/executor/SynchronousSPFExecutor.java
 
b/resolver/src/main/java/org/apache/james/jspf/executor/SynchronousSPFExecutor.java
index db614dc..2ed78a0 100644
--- 
a/resolver/src/main/java/org/apache/james/jspf/executor/SynchronousSPFExecutor.java
+++ 
b/resolver/src/main/java/org/apache/james/jspf/executor/SynchronousSPFExecutor.java
@@ -68,7 +68,7 @@ public class SynchronousSPFExecutor implements SPFExecutor {
                     checker = session.popChecker(c -> c instanceof 
SPFCheckerExceptionCatcher);
                     if (checker == null) {
                         // Error case not handled by JSPF. Throw to avoid 
infinite loop. See JSPF-110.
-                        throw new RuntimeException(e);
+                        throw new RuntimeException("SPFCheckerExceptionCatcher 
implementation not found, session: " + session, e);
                     }
                     try {
                         ((SPFCheckerExceptionCatcher) checker).onException(e, 
session);


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

Reply via email to