# Body storage, encryption and sensitive content

How much of the message text Mail Log stores is up to you. This page explains the storage modes, the encryption and the special treatment of sensitive mails. All settings are found in the *options* under the tabs *body storage*, *raw MIME* and *sensitive content*.

<div class="callout info" id="bkmrk-changes-to-the-stora">Changes to the storage mode only affect **new** entries. Mails already stored stay as they are.

</div>## The storage modes for the body

<figure id="bkmrk-the-tab-body-storage"> ![The options tab body storage](https://docs.graup-it.de/uploads/images/gallery/2026-08/KF2doku-04-optionen-body.png) <figcaption>The tab *body storage* controls how much of the text is kept.</figcaption></figure><table class="table" id="bkmrk-modewhat-is-stored-m"> <thead> <tr><th scope="col">Mode</th><th scope="col">What is stored</th></tr> </thead> <tbody> <tr><td>**Metadata + first N KB**  
*(default)*</td><td>Only the first kilobytes of the text. Enough for an impression without storing long messages in full. You set the size with *body size to keep (KB)* (default 4 KB).</td></tr> <tr><td>**Full body**</td><td>The complete text in plain.</td></tr> <tr><td>**Full, encrypted**</td><td>The complete text, encrypted in the database (see below).</td></tr> <tr><td>**Full, deleted automatically after N days**</td><td>The complete text, but the maintenance task removes it again after the configured period and keeps the metadata only.</td></tr> <tr><td>**Metadata only**</td><td>No text at all — only sender, recipient, subject, status and time.</td></tr> </tbody></table>

In addition, *maximum body size (KB)* limits every text as a global safety ceiling; larger bodies are truncated and marked as truncated in the detail view.

## Raw MIME

Independently of the body mode, the tab *raw MIME* lets you store the exact RFC822 message as it was sent. That allows clean **.eml** downloads for an audit. Because the raw MIME contains the complete plain text, this option is **switched off out of the box**. It can be encrypted as well.

## Encryption

<figure id="bkmrk-the-tab-sensitive-co"> ![The options tab sensitive content](https://docs.graup-it.de/uploads/images/gallery/2026-08/O06doku-05-sensible-inhalte.png) <figcaption>The tab *sensitive content* with the subject and masking patterns.</figcaption></figure>Mail Log protects encrypted bodies and MIME messages with a modern method (AES-256-GCM or XChaCha20-Poly1305). What matters is where the key comes from:

<div class="callout success" id="bkmrk-the-key-is-derived-f">The key is derived from the **Joomla secret** (in your `configuration.php`) and is **not held in the database**. An attacker who captures only the database therefore cannot decrypt the content.

</div><div class="callout warning" id="bkmrk-the-flip-side%3A-if-yo">The flip side: if you change the Joomla secret, previously encrypted entries can no longer be read. The secret is part of the core of your Joomla installation that needs protecting anyway — treat it accordingly.

</div>The field *encryption key* in the options is, as of this version, purely a **status display**. You do not have to enter or generate anything. If it shows a "legacy key", it comes from an earlier version; the maintenance task *migrate legacy-encrypted bodies* converts such entries to the new method and removes the legacy key afterwards by itself.

## Sensitive mails

Some mails should never end up in the log in plain text — password resets, confirmation links, one-time codes. Mail Log recognises them by the subject line and treats them separately.

The tab *sensitive content* holds two pattern lists for this (one regular expression per line) and one policy:

<table class="table" id="bkmrk-subject-patternsif-t"> <tbody> <tr><td>**Subject patterns**</td><td>If the subject matches one of the patterns, the mail counts as sensitive. Out of the box there are patterns for `password`, `passwort`, `reset`, `token`, `2fa`, `verify` and `verifizier`.</td></tr> <tr><td>**Handling of sensitive mails**</td><td>*Metadata only* (default, no body, no attachments), *log normally* or *do not log at all*.</td></tr> <tr><td>**Body masking patterns**</td><td>Additional patterns whose matches are replaced by `***` in the stored text — `token=…` or `key=…`, for example.</td></tr> </tbody></table>

With the default settings a password reset link therefore does not end up in the log, without you having to set anything up.

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

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