Filtering Mailhook Emails
Control which emails sent to your mailhook address actually start the workflow.
Overview
By default, every email that reaches your mailhook address fires the workflow. Two optional filters narrow that down: a from allowlist (who may trigger it) and a subject regex (what the subject must look like). Emails that fail a filter are dropped silently: no run, no bounce, no error.
Filters are useful when the address receives more than you want to process, for example a forwarding rule that mirrors a busy inbox, or a vendor that sends both invoices and marketing mail to the same notification address.
Configuration
- Open the workflow and click the Trigger node.
- Fill in From allowlist and/or Subject regex.
- Save the workflow. Filter changes only take effect on save.
From Allowlist
A comma-separated list of patterns. An email passes if its sender matches any entry:
orders@vendor.com- Matches that exact address.@acme.com- Matches any sender at acme.com.
Example: @acme.com, billing@vendor.com accepts everyone at acme.com plus one specific vendor address.
Subject Regex
A JavaScript-flavor regular expression tested against the subject line. The email passes only if the subject matches. Examples:
^INV-\d+- Subjects starting with an invoice number likeINV-2041.order (confirmed|shipped)- Subjects containing either phrase.
If both filters are set, both must pass.
Tips
- Start without filters, watch a few real runs to see what actually arrives, then tighten.
- Prefer the subject regex when one sender emails you for several reasons; prefer the allowlist when many senders email you for one reason.
- Keep regexes simple. Anchors (
^) and literal prefixes catch most cases and are easy to reason about later. - An invalid regex never matches, which silently blocks all runs. Test the expression before saving.
Common Pitfalls
- Treating the allowlist as security - Sender addresses can be spoofed. The allowlist is routing hygiene, not authentication. The unguessable address is the real access control; regenerate it if it leaks.
- Silent drops - Filtered-out emails produce no visible error. If expected runs are missing, remove the filters temporarily to confirm mail is arriving, then re-add them one at a time.
- Forgetting to save - Filter edits in the panel do nothing until you save the workflow.
Related Articles
- Setting Up a Mailhook Trigger
- Changing Your Mailhook Email Address
- Setting Up an Email Trigger
- Working with Variables and Templates