Hi @VincentB ,
if you have administrative access to kopano-server, your idea could be realized server-side (imho):
kopano-spooler and kopano-dagent, responsible for outgoing(spooler) and incoming(dagent) mail, both implement a plugin-framework (python), that should be appropriate to handle your task with a manageable effort of python-coding.
A user defined plugin hooks into the delivery process of the aforementioned daemons and will get invoked on below events:
def PostConverting(self, session, addrbook, store, folder, message):
def PreDelivery(self, session, addrbook, store, folder, message):
def PostDelivery(self, session, addrbook, store, folder, message):
def PreRuleProcess(self, session, addrbook, store, rulestable):
def SendNewMailNotify(self, session, addrbook, store, folder, message):
The prototypes are declared in /usr/share/kopano-spooler/python/plugintemplates.py
But, as Felix, said, this is off-topic for the webapp-forum.
++umgfoin.