The AWS API for WorkMail does not provide any function to label, move or copy emails to a specific folder. Is there a way to define flow rules programmatically? I would like to trigger a Lambda function when a mail arrives, classify the mail based on its content, and then label it in some way (e.g. moving it into a folder where all emails of the same label are located).
What is the best way to do so?