---
summary: How ScaiLine decides which template a sender gets, for which recipients and
  when.
order: 4
title: Rules
path: concepts/rules
status: published
---

# Rules

Rules connect people to templates. Enabled rules are evaluated in priority order, and the first
rule that matches wins, separately for internal and for external recipients. A sender no rule
matches gets the organisation's default template if one is set, and otherwise no signature.

## What a rule matches

| Condition | Meaning |
|---|---|
| Senders | Specific users, members of groups, users under organisational-unit paths, or senders on specific domains. No senders means everyone. |
| Exceptions | Users or groups the rule does not apply to, even if they match. |
| Recipients | `all`, `internal` or `external`. |
| Window | An optional start and end time, for example for a temporary signature during an event. |
| Recipient domains, subject patterns | Messages to these domains, or with these subjects, are left without a signature. |

## What a rule does

| Action | Effect |
|---|---|
| Apply template | The matching senders get this template's compiled signature. |
| Skip | The matching senders get no signature for this recipient scope. |

## Testing

The tester on the **Rules** page takes a sender and a recipient address and shows which rule
applies and why ("rule 10 applies template *Default*"), and highlights that rule in the list. Use
it before and after every change.

## Piloting

Start with a rule limited to a small group (for example an IT group) above a catch-all *skip*
rule, check the result on real mail, then widen the group or replace it with everyone.

## When changes take effect

Saving a rule recompiles the affected signatures within seconds. The hosted relay uses them
immediately; a milter picks them up with its next snapshot, usually within two minutes.
