linagora / james-project

Mirror of Apache James Project
Apache License 2.0
72 stars 62 forks source link

matcher tag: more flexible operators #5326

Open chibenwa opened 1 week ago

chibenwa commented 1 week ago

Today the following label onto the mailet tag are permitted:

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 ai@something.com. 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:

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