Before
An administrator would need to retrieve the active users in the domain and configure mailbox monitoring for each user individually. They would also need to obtain authorization details, stop existing watches, apply the sent-mail filter, and recreate the watch for every mailbox.
How it works
- Retrieve up to 100 non-suspended users from the domain after the emailhook event starts the workflow.
- For each user, set the required mail scope, generate an authorization token, and stop the existing mailbox watch.
- Create a new watch filtered to sent messages and route its notifications to the configured monitoring topic.
Workflow details
- Trigger and user discovery: An emailhook event starts the workflow, which retrieves up to 100 non-suspended users from the domain for processing.
- Per-user configuration: The workflow processes each user individually, setting the mail scope and invoking a nested flow to generate an authorization token for that mailbox.
- Watch reset: Before creating the new monitoring subscription, the existing mailbox watch for each user is stopped so that the monitoring configuration can be refreshed cleanly.
- Sent-mail filtering: A new watch is then created for each user's mailbox with the SENT label included, limiting notifications to sent-email activity.
- Centralized delivery: The resulting mailbox notifications are directed to the configured sent-email monitoring topic, creating a repeatable handoff for downstream processing.
What changed
Mailbox-watch maintenance becomes an automated per-user process triggered by an emailhook event. The workflow now applies the authorization, reset, sent-mail filtering, and notification-routing steps consistently across the active user list without requiring an administrator to configure each mailbox separately.
Work removed
Retrieving active users, generating per-user authorization details, stopping existing mailbox watches, applying the SENT label filter, recreating watches, and configuring the monitoring destination for each mailbox.
Expected outcome
One workflow run can refresh sent-email monitoring for up to 100 active user mailboxes, replacing repeated per-mailbox watch configuration with a single automated pass.
