Microsoft Outlook Trigger: filter emails by sender domain

The idea is:

Add a “Sender Domain” filter to the Microsoft Outlook Trigger. The trigger then emits only the emails whose sender address is in that domain or in one of its subdomains.

For example, example.com matches alice@example.com and bob@mail.example.com. It does not match carol@notexample.com.

My use case:

A partner sends us a daily email with a CSV attachment. The person on duty that day sends it, so the sender address changes. The domain is always the same.

The current “Sender” filter matches one exact address or display name. So today the trigger must emit every email with an attachment, and a later node must drop the emails from other senders.

I think it would be beneficial to add this because:

Many teams receive reports and notifications from a domain, not from one address. A domain filter in the trigger keeps unrelated emails out of the workflow. It also removes the executions that only drop an email.

Any resources to support this?

So the trigger must match the domain after it fetches the messages.

Are you willing to work on this?

Yes. I have an implementation with unit tests. I will open a pull request that links to this topic.

Hi @aneeshmelkot, I agree this would be a useful filter. I have run into the same rotating-sender problem with partner reports: the sender changes, but the domain does not, so a single-address filter is not enough.

Until a domain filter is available, this is how I handle it today:

  1. Leave the Microsoft Outlook Trigger broad, then add an IF node right after it.
  2. In that IF node, test the sender address from the trigger output. I normalize it to lower case first, then check that it is either exactly the domain or a subdomain of it.

For example.com, the logic is:

  • sender ends with “@example.com” OR
  • sender ends with “.example.com”

That second check is the important part. It lets bob@mail.example.com through, while keeping carol@notexample.com out. A simple “contains example.com” check would incorrectly match notexample.com.

  1. Send only the true branch to your CSV and attachment handling. Let the false branch end there, or log it, so unrelated mail does not run the rest of the workflow.

If you can control the mailbox, there is an even cleaner option: add an Outlook rule that moves mail from that domain into a dedicated folder, then point the Outlook Trigger at that folder. I use the IF check when I cannot control mailbox rules, or when subdomains change often.

On your Graph point, I agree the matching will likely need to happen after fetching, for the $filter and $search reasons you listed. The implementation should also document the subdomain choice clearly, since your example treats mail.example.com as a match rather than requiring an exact-domain match only.

The subdomain case in your example is the test I would add first once you link the pull request.