## TL;DR
Rule evaluation has a per-message time budget. Rules that scan large messages, expand huge groups, run many regex conditions, or evaluate long recipient lists can exceed it, after which Exchange stops or fails open depending on configuration. Find the heavy rule from the trace, measure which condition is expensive, and split or simplify it rather than raising expectations of the engine.

```text
"rule evaluation exceeded time limit" exchange transport rule
```

## Use this when
- Message trace or admin alerts cite rule evaluation exceeding the time limit.
- Delivery delays correlate with one recently added complex rule.

## Not for this skill when
- A single rule never fires at all. That is a matching problem, not a performance problem.
- Delays affect all mail including internal mail with no rules. Look at transport service health instead.

## Steps
1. Identify affected messages and list every rule that evaluated on them from the trace. Verify: the candidate heavy rules are named.
2. Inspect those rules for expensive patterns: message body scanning on large attachments, group expansion, nested conditions and long regex lists. Verify: the likely expensive condition in each rule is flagged.
3. Disable or bypass the heaviest rule for a test message of similar size and re-measure evaluation. Verify: the time limit error disappears or persists, confirming the culprit.
4. Optimise the rule: pre-filter on cheap header conditions first, split by audience, replace body scans with header or verdict conditions where possible. Verify: the rewritten rule matches the same intended messages on test cases.
5. Re-enable and monitor rule errors and delivery latency for a day. Verify: no time limit errors recur on comparable traffic.

## Variant phrasings
### exchange mail flow rule evaluation timeout performance
The performance phrasing variant.
### transport rule slow large attachment body scan
The expensive condition variant.

Compatibility: Exchange Online and Exchange Server transport rule engines.

## Why it happens
The transport engine evaluates rules inline with delivery, so its budget protects mail flow. Complexity that is cheap on a small text message becomes expensive on a 20 MB attachment evaluated against dozens of patterns.

## Edge cases / pitfalls
- Order conditions cheap-first within a rule so most messages exit early.
- Regular-expression lists copied from blocklists grow silently. Review them as code.
- A rule that times out may apply partially across recipients. Check for inconsistent actions after an incident.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_myJqy0YhKfJZdLCQrRq6Ww
