Before
An administrator likely had to retrieve mailbox activity, search through messages for those meeting the spam criteria, and decide which messages to remove. Each qualifying message then required a separate deletion action, followed by manually recording or reporting what happened.
How it works
- Receive the mailbox activity event and retrieve the relevant messages.
- Check whether messages match the configured processing criteria and branch based on whether results are found.
- Delete each matching message, consolidate the processing data, and build an outcome record; otherwise, build a no-results record.
Workflow details
- Trigger and message retrieval: The workflow starts when an emailhook event is received, then retrieves mail activity details and uses those details to obtain the relevant mailbox messages.
- Automated decision: A condition evaluates whether matching results were found. The flow follows a cleanup path when qualifying messages are present and an alternate results path when no matches are found.
- Message cleanup: When the condition is met, the matching email collection is expanded so individual messages can be processed, and each selected message is deleted from the mailbox using its message identifier.
- Result consolidation: After deletion, the processed email data is consolidated before the workflow builds a final result. If no messages qualify, the alternate branch builds a result without performing deletion.
- Operational outcome: The workflow provides a repeatable mailbox-cleanup process that handles discovery, decision-making, deletion, and result recording in a single automated run.
What changed
Mailbox searches, result checks, per-message deletions, and outcome recording now occur in one automated flow. Human operators no longer need to perform the recurring cleanup sequence manually, while the workflow preserves a separate outcome for runs with no matching messages.
Work removed
Manually retrieving mailbox activity, reviewing messages for matching spam criteria, checking whether results were found, copying or collecting message identifiers, deleting qualifying messages individually, and recording the cleanup outcome.
Expected outcome
At minimum, one manual search-and-delete cycle per matching message is replaced by an automated run that also records whether messages were removed or no matches were found.