# Log rules and display rules

Mail Log has two kinds of rules that are easy to confuse but do very different things. Both are found in the *options*.

<div class="callout info" id="bkmrk-log-rules-decide-whi">**Log rules** decide which mails are stored at all.  
 **Display rules** only decide which stored mails appear in the list.

</div>## Log rules: what is never stored in the first place

<figure id="bkmrk-log-rules-filter-bef"> ![The options tab log rules with mode and rule table](https://docs.graup-it.de/uploads/images/gallery/2026-08/xxkdoku-06-log-regeln.png) <figcaption>Log rules filter before anything is stored.</figcaption></figure>Log rules take effect **before** anything is written to the database. That keeps uninteresting bulk mail out of the log — noisy notifications from a particular service, for instance. What a log rule excludes never becomes an entry.

Two settings determine the behaviour:

<table class="table" id="bkmrk-modeexclude-matches-"> <tbody> <tr><td>**Mode**</td><td>*Exclude matches* — matching mails are NOT logged. *Include matches only* — ONLY matching mails are logged, everything else is discarded.</td></tr> <tr><td>**Match**</td><td>Whether a mail has to satisfy *all* rules (AND) or *any* of them (OR).</td></tr> </tbody></table>

## Display rules: what is hidden in the list

Display rules take effect **after** storing. Matching entries are merely hidden in the list and on the dashboard — nothing is deleted. Change the rule and the entries reappear. Useful for tidying up an overloaded view without losing data.

## How a rule is put together

Both rule types are built from the same parts. Every rule checks a **field** with an **operator** against a **value**:

<table class="table" id="bkmrk-fieldsubject%2C-body%2C-"> <tbody> <tr><td>**Field**</td><td>Subject, body, recipient or sender.</td></tr> <tr><td>**Operator**</td><td>contains, does not contain, equals, does not equal, starts with, ends with — for display rules additionally is empty / is not empty.</td></tr> <tr><td>**Value**</td><td>The text to compare against.</td></tr> </tbody></table>

## Examples

- **Do not log cron job mails:** log rule, mode *exclude matches*, field *sender*, operator *contains*, value `cron@`.
- **Log order mails only:** log rule, mode *include matches only*, field *subject*, operator *contains*, value `order`.
- **Hide internal test mails:** display rule, field *recipient*, operator *ends with*, value `@internal.example`.

<div class="callout warning" id="bkmrk-the-mode-include-mat">The mode *include matches only* for log rules is sharp: everything that does not match is not logged. Use it deliberately and check afterwards that the mails you want still reach the log.

</div><small>Applies to version 1.0.5.</small>

[Deutsche Fassung](https://docs.graup-it.de/link/85)