Tran Hong Quan created JAMES-4087:
-------------------------------------

             Summary: Combining composite matchers
                 Key: JAMES-4087
                 URL: https://issues.apache.org/jira/browse/JAMES-4087
             Project: James Server
          Issue Type: Bug
          Components: Mailet Contributions
            Reporter: Tran Hong Quan


Today chaining composite matcher is not possible:

```
+            <matcher name="relay-allowed" 
match="org.apache.james.mailetcontainer.impl.matchers.Or">
+                <matcher match="SMTPAuthSuccessful"/>
+                <matcher match="SMTPIsAuthNetwork"/>
+                <matcher match="SentByMailet"/>
+                <matcher match="org.apache.james.jmap.mailet.SentByJmap"/>
+            </matcher>
+            <matcher name="should-check-spam" 
match="org.apache.james.mailetcontainer.impl.matchers.Not">
+                <matcher match="relay-allowed"/>
+            </matcher>
```

yields error:

`Fatal error while starting 
James","context":"default","exception":"jakarta.mail.MessagingException: Can 
not load matcher relay-allowed\n\tat 
org.apache.james.utils.GuiceMatcherLoader.getMatcher(GuiceMatcherLoader.java:50)\n\tat`

Expectation: chaining composite matchers should be doable.

Also, I spotted that we have a `notmatch` tag in our code (beside traditional 
`match` tag used), we should try to add a few tests for it to make sure it is 
usable.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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