# Spam-Testing & Inbox-Platzierung (mail-tester.com + iCloud/Apple)

Use when the owner reports "die Mail ist im Spam gelandet" or before sending a high-stakes single mail (investor outreach, persona pitch) that must arrive.

## mail-tester.com workflow (no account needed)

1. Open `https://www.mail-tester.com/` in the browser tool. The test address is the JS-filled input (`#email`, `data-prefix="test"`, `data-domain="srv1.mail-tester.com"`) — read its value via `js("document.getElementById('email').value")`, do NOT invent a local part: self-chosen prefixes are rejected ("You can not use … to test your emails"; registered/branded prefixes like a project name are reserved). The address appears in NO text node of the DOM — innerText/outerHTML searches for `@` come back empty; only the input's `.value` holds it.
2. Send the exact real mail (same From, subject, body) via the Resend API to that address.
3. Wait ~60-75 s, then fetch `https://www.mail-tester.com/<local-part>` with a browser UA and parse:
   - score via regex `(\d+(?:\.\d+)?)\s*/\s*10`
   - `X-Spam-Status: No/x.x/5.0` line (SpamAssassin)
   - `Authentication-Results`: SPF/DKIM/DMARC pass
   - The JSON variant `&format=json` returns HTML — parse the HTML page instead.
4. Free tier allows ~3 tests per address; a fresh homepage visit proposes a new address.

## Reading the result honestly

- A 9.5/10 with SPF+DKIM+DMARC pass and no blacklists can STILL land in iCloud spam — Apple weighs domain reputation and recipient engagement more than SpamAssassin. The only typical deduction for a young domain is `FROM_FMBLA_NEWDOM` (registered <7 days/recent), which only fades with domain age.
- Levers that actually exist: DMARC enforcement (`p=quarantine`, strict alignment — see below), removing trigger words from the content, and ONE "Nicht Spam" click by the recipient (strongest lever; all future mail then inboxes).
- Report placement expectations honestly: for a freshly-registered domain the FIRST mail to a new recipient often lands in spam even when clean — say so BEFORE sending, and warm the domain with gradual volume.

## DMARC hardening (own bind9 zones)

Set `_dmarc` TXT to `"v=DMARC1; p=quarantine; pct=100; rua=mailto:dmarc@<domain>; adkim=s; aspf=s"` — edit the zone file with sudo (patch tool refuses /etc paths), bump the serial, `sudo rndc reload <zone>`, verify with `dig +short TXT _dmarc.<domain> @127.0.0.1`. Strict alignment is fine with Resend because the DKIM signature `d=` equals the From domain.

## Content style for inbox placement

- FEW emojis, business-like calm subject, personal human-to-human tone instead of marketing layout — an emoji-heavy HTML marketing mail was the difference between spam landing and inbox for iCloud even with clean authentication.
- Best pattern: have a subagent write/rewrite the mail under these antispam constraints, then send the reviewed version (fits the owner's quality rule of agent-reviewed content anyway).

## V2 resend flow after a spam landing


1. Harden DMARC, rewrite content to remove investment/crypto trigger words (percentages, ticker symbols, network names, "Garantie") while keeping the persuasion, keep plain text — plus the content style rules above.
2. Re-test the V2 at mail-tester (≥9.5, DMARC pass with p=quarantine) BEFORE resending.
3. Send V2 to the real recipient, confirm `last_event: delivered` via `GET https://api.resend.com/emails/{id}`.
4. Tell the owner the one-time "Nicht Spam" recommendation for the recipient.
