# Message archive

The message archive writes a copy of your emails and their delivery events to a bucket you own. Lettermint only adds new objects. It never reads, changes, or deletes anything in the bucket, so the archive works with S3 Object Lock.

The message archive is in early access. Contact support to turn it on for your team.

## What Lettermint writes

For each email in the scope of a destination:

- The email as `message.eml`, as `message.json` with its metadata, headers, and recipients, or both.
- The attachments of inbound emails, and of sent emails when the format is JSON only.
- One object per delivery event, such as sent, delivered, bounced with the SMTP response, suppressed, complaint, or quarantined.
- One object per webhook delivery, with its payload and attempts, once it succeeds or runs out of retries.
- Opens and clicks, if you turn on **Include opens and clicks**.

Emails sent in [sandbox mode](/platform/projects-and-routes/sandbox-mode) are not archived. The archive includes email content also when **Hide email content** is on for the project or route.

## Object layout

The path template sets the folder of each email. The default is `{project}/{yyyy}/{mm}/{dd}/{message_id}/`. You can also use `{team}` and `{route}`. The template must contain `{message_id}`.

```text
acme-mail-archive/
└── 7f3c…-project-id/
    └── 2026/12/04/
        └── 9d2c…-message-id/
            ├── message.eml
            ├── message.json
            ├── attachments/
            │   └── 0-invoice.pdf
            ├── events/
            │   ├── 20261204T101500.123456Z-sent-3f2a….json
            │   └── 20261204T101502.654321Z-delivered-3f2a….json
            └── webhooks/
                └── 20261204T101503.000000Z-<delivery-id>.json
```

Event names start with a UTC timestamp, so they sort by time. The last part of an event name identifies the recipient without showing the address.

## Set up a destination

1. Go to **Manage team** → [**Data & compliance**](https://app.lettermint.co/team/compliance) and select **Add destination** under **Message archive**.
2. Choose the provider and enter the region or endpoint, the bucket, and an access key.
3. Choose which emails to archive: the whole team, selected projects, or selected routes.
4. Choose the format, the path template, and the server-side encryption, then select **Create destination**.
5. On the destination page, select **Test connection**. Lettermint writes a small `.lettermint-probe-….json` object under the path prefix.
6. Turn on **Archiving**.

A change to the connection settings turns archiving off until a new test passes.

## Access policy

Give the access key only the right to write new objects under the path prefix. Lettermint does not need to read, list, or delete. The **Access policy** card on the destination page shows an IAM policy for Amazon S3, Wasabi, MinIO, and other providers that accept one. For Cloudflare R2, Backblaze B2, and DigitalOcean Spaces it shows how to scope the key instead.

## Retries and missed objects

Lettermint writes new objects every minute. If the bucket refuses a write, Lettermint retries it for 72 hours. After that the object counts as **failed**.

Lettermint reads the email from its own storage when it writes `message.eml`, `message.json`, and attachments. If [message retention](/platform/emails/data-retention) deletes the email first, these objects count as **missed** and cannot be archived anymore. With a retention period of 0 or 1 day, this happens when your bucket refuses writes for about two days. Event objects carry their own data and always get the full 72 hours. Webhook objects can hold message content, so they also count as missed when message retention deletes the email first.

### Retry failed objects

Lettermint keeps failed objects for 3 days after they fail. During that time, select **Retry failed objects** on the destination page to write them again. After 3 days, Lettermint deletes them.

Lettermint keeps the data of a waiting or failed event object until it is written or deleted, also when your message retention period is shorter: at most 72 hours of retries plus 3 days. This also applies when you turn a destination off. Message content is never kept longer than your retention period. Content and webhook objects that are not written when message retention deletes the email become missed.

### Emails to Owners

Team Owners get an email when:

- No write has succeeded for an hour. The destination turns unhealthy, and Lettermint tries one write every 15 minutes. Fix the cause and select **Retry now**.
- Writes still fail after 24 hours. The email says when Lettermint stops retrying the waiting objects.
- Objects failed or were missed. You get at most one such email per destination per day, with the number of objects and a few example paths.

When writes succeed again, Owners see a notification in the dashboard.
