Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

matcher tag: more flexible operators #5326

Open
chibenwa opened this issue Nov 12, 2024 · 0 comments
Open

matcher tag: more flexible operators #5326

chibenwa opened this issue Nov 12, 2024 · 0 comments

Comments

@chibenwa
Copy link
Member

chibenwa commented Nov 12, 2024

Today the following label onto the mailet tag are permitted:

  • match includes only recipients matching the condition
  • notmatch includes only recipients not matching the condition

While this is enough for 99% of the use cases we may encounter use cases where we are limited:

For our AI mailbot integration we want to ingest the email into the GPT chain if at least one of the recipient is [email protected]. This forced us to write https://github.com/linagora/tmail-backend/blob/master/tmail-backend/tmail-third-party/open-ai/src/main/java/com/linagora/tmail/mailet/RecipientsContain.java

Instead we could have generic mailet tags allowing to augment existing matchers:

  • all_match: condition needs to be satisfied for all recipients
  • at_least_one_match: return all recipients if one matches
  • no_match: equivalent to not at_least_one_match and ensure no recipient match this all

Modification can be done in https://github.com/apache/james-project/blob/d43cfea12cd3e8db556edf84c06fc7e555ad940d/server/mailet/mailetcontainer-impl/src/main/java/org/apache/james/mailetcontainer/lib/AbstractStateMailetProcessor.java#L227

Recorded as an idea for easy contributions, eg for OktoberFest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant