Open chibenwa opened 1 week ago
Today the following label onto the mailet tag are permitted:
match
notmatch
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
ai@something.com
Instead we could have generic mailet tags allowing to augment existing matchers:
all_match
at_least_one_match
no_match
not at_least_one_match
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
Today the following label onto the mailet tag are permitted:
match
includes only recipients matching the conditionnotmatch
includes only recipients not matching the conditionWhile 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.javaInstead we could have generic mailet tags allowing to augment existing matchers:
all_match
: condition needs to be satisfied for all recipientsat_least_one_match
: return all recipients if one matchesno_match
: equivalent tonot at_least_one_match
and ensure no recipient match this allModification 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