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

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


The following commit(s) were added to refs/heads/master by this push:
     new e91ba9f337 [FIX] Doc and validation were impacted by typo 
s/onMatcherException/o… (#2563)
e91ba9f337 is described below

commit e91ba9f337fe3412a3ea95eec3e8e491a13b681f
Author: Benoit TELLIER <btell...@linagora.com>
AuthorDate: Wed Dec 11 17:20:13 2024 +0100

    [FIX] Doc and validation were impacted by typo s/onMatcherException/o… 
(#2563)
    
    Co-authored-by: Rene Cordier <rcord...@linagora.com>
---
 docs/modules/servers/partials/RemoteDelivery.adoc                 | 2 +-
 docs/modules/servers/partials/configure/mailetcontainer.adoc      | 4 ++--
 .../src/test/java/org/apache/james/mailets/MailetErrorsTest.java  | 8 ++++----
 .../mailetcontainer/lib/AbstractStateCompositeProcessor.java      | 7 +++++--
 .../java/org/apache/james/transport/mailets/RemoteDelivery.java   | 2 +-
 src/site/xdoc/server/config-mailetcontainer.xml                   | 4 ++--
 6 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/docs/modules/servers/partials/RemoteDelivery.adoc 
b/docs/modules/servers/partials/RemoteDelivery.adoc
index d12e219c62..abd1b446c0 100644
--- a/docs/modules/servers/partials/RemoteDelivery.adoc
+++ b/docs/modules/servers/partials/RemoteDelivery.adoc
@@ -37,7 +37,7 @@ Default is 0.
 be delivered to for DSN bounce processing. Default is to send a traditional 
message containing the bounce details.
 * *onSuccess* (optional) - if specified, this processor is called for each 
email successfully sent to remote third parties.
 
-When using bounceProcessor or onSuccess processors, take special care of error 
handling (see onMailetException and onMatcherException)
+When using bounceProcessor or onSuccess processors, take special care of error 
handling (see onMailetException and onMatchException)
  to avoid confusing situations. Also remember that on partial delivery, both 
processors will be used: *onSuccess* with successfull recipients,
  and *bounceProcessor* with failed recipients.
 
diff --git a/docs/modules/servers/partials/configure/mailetcontainer.adoc 
b/docs/modules/servers/partials/configure/mailetcontainer.adoc
index b7cd767907..ee83804ec1 100644
--- a/docs/modules/servers/partials/configure/mailetcontainer.adoc
+++ b/docs/modules/servers/partials/configure/mailetcontainer.adoc
@@ -90,7 +90,7 @@ exception, propagating it to the execution context. In an 
SMTP execution context
 the item and automatic retries will be setted up - note that attempts will be 
done for each recipients. In LMTP
 (if LMTP is configured to execute the mailetContainer), the entire mail 
transaction is reported as failed to the caller.
 
-Moreover, the *onMatcherException* allows you to override matcher error 
handling. You can
+Moreover, the *onMatchException* allows you to override matcher error 
handling. You can
 specify another processor than the *error* one for handling the errors of this 
mailet. The *matchall*
 special value also allows you to match all recipients when there is an error. 
The *nomatch*
 special value also allows you to match no recipients when there is an error.
@@ -101,6 +101,6 @@ Here is a short example to illustrate this:
 ....
 <mailet match=RecipientIsLocal class="LocalDelivery">
     <onMailetException>deliveryError</onMailetException>
-    <onMatcherException>nomatch</onMatcherException>
+    <onMatchException>nomatch</onMatchException>
 </mailet>
 ....
\ No newline at end of file
diff --git 
a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/MailetErrorsTest.java
 
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/MailetErrorsTest.java
index 7f1573225e..c35e745b89 100644
--- 
a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/MailetErrorsTest.java
+++ 
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/MailetErrorsTest.java
@@ -689,7 +689,7 @@ class MailetErrorsTest {
     }
 
     @Test
-    void 
onMatcherExceptionIgnoreShouldNotMatchWhenRuntimeExceptionAndNoMatchConfigured(@TempDir
 File temporaryFolder) throws Exception {
+    void 
onMatchExceptionIgnoreShouldNotMatchWhenRuntimeExceptionAndNoMatchConfigured(@TempDir
 File temporaryFolder) throws Exception {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
             .withMailetContainer(MailetContainer.builder()
@@ -717,7 +717,7 @@ class MailetErrorsTest {
     }
 
     @Test
-    void 
onMatcherExceptionIgnoreShouldNotMatchWhenMessagingExceptionAndNoMatchConfigured(@TempDir
 File temporaryFolder) throws Exception {
+    void 
onMatchExceptionIgnoreShouldNotMatchWhenMessagingExceptionAndNoMatchConfigured(@TempDir
 File temporaryFolder) throws Exception {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
             .withMailetContainer(MailetContainer.builder()
@@ -745,7 +745,7 @@ class MailetErrorsTest {
     }
 
     @Test
-    void 
onMatcherExceptionIgnoreShouldMatchWhenRuntimeExceptionAndAllMatchConfigured(@TempDir
 File temporaryFolder) throws Exception {
+    void 
onMatchExceptionIgnoreShouldMatchWhenRuntimeExceptionAndAllMatchConfigured(@TempDir
 File temporaryFolder) throws Exception {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
             .withMailetContainer(MailetContainer.builder()
@@ -773,7 +773,7 @@ class MailetErrorsTest {
     }
 
     @Test
-    void 
onMatcherExceptionIgnoreShouldMatchWhenMessagingExceptionAndAllMatchConfigured(@TempDir
 File temporaryFolder) throws Exception {
+    void 
onMatchExceptionIgnoreShouldMatchWhenMessagingExceptionAndAllMatchConfigured(@TempDir
 File temporaryFolder) throws Exception {
         jamesServer = TemporaryJamesServer.builder()
             .withBase(SMTP_ONLY_MODULE)
             .withMailetContainer(MailetContainer.builder()
diff --git 
a/server/mailet/mailetcontainer-impl/src/main/java/org/apache/james/mailetcontainer/lib/AbstractStateCompositeProcessor.java
 
b/server/mailet/mailetcontainer-impl/src/main/java/org/apache/james/mailetcontainer/lib/AbstractStateCompositeProcessor.java
index 0fd4674cc9..77446cee39 100644
--- 
a/server/mailet/mailetcontainer-impl/src/main/java/org/apache/james/mailetcontainer/lib/AbstractStateCompositeProcessor.java
+++ 
b/server/mailet/mailetcontainer-impl/src/main/java/org/apache/james/mailetcontainer/lib/AbstractStateCompositeProcessor.java
@@ -139,7 +139,10 @@ public abstract class AbstractStateCompositeProcessor 
implements MailProcessor,
             .map(MailetProcessorImpl.class::cast)
             .flatMap(processor -> 
processor.getPairs().stream().map(MatcherMailetPair::getMailet))
             .flatMap(this::requiredProcessorStates)
-            .filter(state -> !state.equals(new ProcessingState("propagate")) 
&& !state.equals(new ProcessingState("ignore")))
+            .filter(state -> !state.equals(new ProcessingState("propagate"))
+                && !state.equals(new ProcessingState("ignore"))
+                && !state.equals(new ProcessingState("nomatch"))
+                && !state.equals(new ProcessingState("matchall")))
             .filter(state -> !processors.containsKey(state.getValue()))
             .collect(ImmutableList.toImmutableList());
 
@@ -152,7 +155,7 @@ public abstract class AbstractStateCompositeProcessor 
implements MailProcessor,
         return Stream.concat(mailet.requiredProcessingState().stream(),
             Stream.of(
                     
Optional.ofNullable(mailet.getMailetConfig().getInitParameter("onMailetException")),
-                    
Optional.ofNullable(mailet.getMailetConfig().getInitParameter("onMatcherException")))
+                    
Optional.ofNullable(mailet.getMailetConfig().getInitParameter("onMatchException")))
                 .flatMap(Optional::stream)
                 .map(ProcessingState::new));
     }
diff --git 
a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java
 
b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java
index 29f84f0731..fabfeff689 100644
--- 
a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java
+++ 
b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java
@@ -92,7 +92,7 @@ import com.google.common.collect.ImmutableMap;
  * be delivered to for DSN bounce processing. Default is to send a traditional 
message containing the bounce details.</li>
  * <li><b>onSuccess</b> (optional) - if specified, this processor is called 
for each email successfully sent to remote third parties.</li>
  * <p>
- * When using bounceProcessor or onSuccess processors, take special care of 
error handling (see onMailetException and onMatcherException)
+ * When using bounceProcessor or onSuccess processors, take special care of 
error handling (see onMailetException and onMatchException)
  * to avoid confusing situations. Also remember that on partial delivery, both 
processors will be used: <code>onSuccess</code> with successfull recipients,
  * and <code>bounceProcessor</code> with failed recipients.
  *
diff --git a/src/site/xdoc/server/config-mailetcontainer.xml 
b/src/site/xdoc/server/config-mailetcontainer.xml
index cfad072d13..ef8b7ccb9f 100644
--- a/src/site/xdoc/server/config-mailetcontainer.xml
+++ b/src/site/xdoc/server/config-mailetcontainer.xml
@@ -96,7 +96,7 @@
           the item and automatic retries will be setted up - note that 
attempts will be done for each recipients. In LMTP
           (if LMTP is configured to execute the mailetContainer), the entire 
mail transaction is reported as failed to the caller.</p>
 
-      <p>Moreover, the <strong>onMatcherException</strong> allows you to 
override matcher error handling. You can
+      <p>Moreover, the <strong>onMatchException</strong> allows you to 
override matcher error handling. You can
           specify another processor than the <strong>error</strong> one for 
handling the errors of this mailet. The <strong>matchall</strong>
           special value also allows you to match all recipients when there is 
an error. The <strong>nomatch</strong>
           special value also allows you to match no recipients when there is 
an error.</p>
@@ -105,7 +105,7 @@
 
       <pre><code>&lt;mailet match=RecipientIsLocal class="LocalDelivery"&gt;
     &lt;onMailetException&gt;deliveryError&lt;/onMailetException&gt;
-    &lt;onMatcherException&gt;nomatch&lt;/onMatcherException&gt;
+    &lt;onMatchException&gt;nomatch&lt;/onMatchException&gt;
 &lt;/mailet&gt;
       </code></pre>
     </subsection>


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

Reply via email to