# Deliverability

Deliverability is whether your email reaches the inbox instead of the spam folder. Mailbox providers such as Gmail, Yahoo and Outlook judge three things: whether the mail is really from you (authentication), whether people want it (engagement, bounces and complaints) and how you have behaved over time (reputation). This page explains how Ha Tang's setup covers authentication and what you control for the rest.

## Authentication and alignment

DMARC passes when SPF or DKIM passes **and** the domain it checked matches (aligns with) the domain in your `From` address. Ha Tang sets up both so they align:

| Check | What Ha Tang does | What you publish | Aligns with `From: you@example.com` |
|---|---|---|---|
| DKIM | Signs every message with your domain's own 2048-bit key (`d=example.com`, selector `rs…`). | The DKIM TXT record. | Yes, the signing domain is your domain. |
| SPF | Uses `bounce+…@send.example.com` as the envelope sender (`Return-Path`). | The SPF TXT and MX records on `send.example.com`. | Yes under relaxed alignment, because `send.example.com` is a subdomain of `example.com`. |
| DMARC | Proposes `v=DMARC1; p=none;` and checks that a DMARC record exists. | The `_dmarc` TXT record. | Uses the two results above. |

Because the SPF and MX records live on the `send.` subdomain, they do not touch the SPF record of your root domain, and you do not need to add Ha Tang to it. See [Domains](https://hatang.dev/docs/guides/email/domains.md) for the exact records.

### Tighten DMARC step by step

`p=none` only monitors. Once your DMARC reports show that all your real mail passes, move to a stricter policy so others cannot spoof your domain:

```text
_dmarc.example.com  TXT  "v=DMARC1; p=none; rua=mailto:dmarc@example.com"
_dmarc.example.com  TXT  "v=DMARC1; p=quarantine; pct=25; rua=mailto:dmarc@example.com"
_dmarc.example.com  TXT  "v=DMARC1; p=reject; rua=mailto:dmarc@example.com"
```

Publish only one of these at a time. `rua` sends you daily aggregate reports; read them with a DMARC report tool before each step. Before you move to `quarantine` or `reject`, check every other service that sends as your domain (your office mailboxes, your CRM, your invoicing tool) and make sure each one passes too.

### What large mailbox providers require

Gmail and Yahoo require bulk senders to authenticate with SPF and DKIM, publish DMARC, offer one-click unsubscribe in marketing mail and keep spam complaints low. With Ha Tang:

- SPF, DKIM and DMARC come from your domain setup above.
- Broadcasts and automation emails get `List-Unsubscribe` and `List-Unsubscribe-Post: List-Unsubscribe=One-Click` headers automatically. See [Broadcasts](https://hatang.dev/docs/guides/email/broadcasts.md#unsubscribe).
- Complaints are tracked in [Metrics](https://hatang.dev/docs/guides/email/metrics-and-logs.md), and every complaint suppresses the address.

Read Google's [Email sender guidelines](https://support.google.com/a/answer/81126) for the current rules.

## Separate your streams

Send different kinds of mail from different domains so that one cannot hurt the other:

| Stream | Example domain |
|---|---|
| Account and transactional mail (receipts, password resets) | `example.com` or `notify.example.com` |
| Marketing (broadcasts, newsletters) | `updates.example.com` |

Each domain you add has its own DKIM key and return path, and Metrics can be filtered per domain. Restrict API keys to a single domain if different systems send different streams.

## Warm up a new domain

A domain or subdomain that has never sent email has no reputation yet. Mailbox providers watch the first weeks closely.

1. Start with your most engaged recipients: people who signed up recently or opened your recent emails.
2. Start with a small volume and increase it gradually over a few weeks, for example by doubling it every few days as long as bounces and complaints stay low.
3. Keep a steady rhythm. Long silences followed by a large burst look like spam.
4. Watch the bounce and complaint rates after each step, and slow down if they rise.

A daily quota per business is a safety net against sudden spikes. You can see it under **Email settings**.

## Keep your lists clean

- **Collect consent.** Only send marketing to people who asked for it. A confirmation email at signup (double opt-in) keeps typos and fake addresses off your list. Never buy or rent lists.
- **Let bounces and complaints suppress.** Ha Tang does it automatically: see [Suppressions and bounces](https://hatang.dev/docs/guides/email/suppressions-and-bounces.md). Do not remove those entries without a good reason.
- **Use topics.** People who can pick fewer emails unsubscribe less and complain less. See [Contacts, segments and topics](https://hatang.dev/docs/guides/email/audiences.md).
- **Remove inactive contacts.** Contacts who have not opened or clicked for months lower your engagement. Stop sending to them or ask them once whether they want to stay.
- **Make unsubscribing easy.** Put the `{{{UNSUBSCRIBE_URL}}}` link where people can find it. A recipient who cannot find it clicks "Report spam" instead.

## Write mail that looks like you

- Use a recognizable `From` name and a stable address, such as `Acme <news@updates.example.com>`.
- Send a plain-text part with your HTML. Templates generate it for you; with `POST /emails`, pass `text`.
- Link to your own domain. With click tracking on, use a [tracking subdomain](https://hatang.dev/docs/guides/email/tracking.md) so tracked links also use your domain.
- Avoid public link shorteners and attachments in marketing mail.
- Make `Reply-To` an address someone reads.

## Monitor

| Signal | Where | Watch for |
|---|---|---|
| Bounce rate | **Email → Metrics** | The dashboard highlights it above **4%**. A sudden rise usually means an old or bought list. |
| Complaint rate | **Email → Metrics** | The dashboard highlights it above **0.08%**. Check how people joined the list and how easy it is to unsubscribe. |
| `email.bounced` with `Policy` or `ContentRejected` | Webhooks, **Email → Emails** | Receiving servers are blocking your content or your reputation. |
| DMARC aggregate reports | The `rua` address of your DMARC record | Mail that fails SPF or DKIM, or services sending as you that you do not know about. |
| Domain reputation at Gmail | [Google Postmaster Tools](https://postmaster.google.com/) | Spam rate and reputation of your domain as Gmail sees it. |

## Checklist

- [ ] The domain is **Verified**, with DKIM, return-path MX and SPF.
- [ ] A DMARC record is published.
- [ ] Marketing and transactional mail come from different domains or subdomains.
- [ ] Every marketing email has a visible unsubscribe link.
- [ ] Your HTML emails also have a plain-text part.
- [ ] Bounce and complaint rates are checked after each large send.

## Next steps

- [Domains](https://hatang.dev/docs/guides/email/domains.md)
- [Suppressions and bounces](https://hatang.dev/docs/guides/email/suppressions-and-bounces.md)
- [Metrics and logs](https://hatang.dev/docs/guides/email/metrics-and-logs.md)

Source: https://hatang.dev/docs/guides/email/deliverability
