Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-4087

Combining composite matchers

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Mailet Contributions
    • None

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            QuanTH Tran Hong Quan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: