feat: SMTP mail stack and separate server.env deploy
Add mail.php with STARTTLS sending, test scripts, server.env split from local .env, admin@ postbox docs, DKIM DNS support-ticket notes, and todo 11 for boka relay. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+52
-20
@@ -1,45 +1,77 @@
|
||||
# 02 — E-Mail & SMTP
|
||||
|
||||
**Priorität:** high
|
||||
**Status:** erledigt (2026-06-11)
|
||||
**Abhängigkeiten:** 01
|
||||
**Blockiert:** 03 (Alarmierung)
|
||||
|
||||
## Ziel
|
||||
|
||||
Mail-Infrastruktur auf 0012.de für Monitoring-Alerts, Skript-Versand und spätere Fremddomains.
|
||||
Mail-Infrastruktur auf 0012.de für Monitoring-Alerts und Skript-Versand.
|
||||
|
||||
Relay von **boka** → ausgelagert nach [`11-boka-smtp-relay.md`](11-boka-smtp-relay.md).
|
||||
|
||||
## Postfach-Setup (Plesk)
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| Postfach | `admin@0012.de` |
|
||||
| Aliase | `monitor@0012.de`, `alert@0012.de` |
|
||||
| SMTP-Login | `admin@0012.de` (Hauptpostfach, nicht Alias) |
|
||||
| Absender Monitoring | `SMTP_FROM=monitor@0012.de` |
|
||||
| Alarm-Empfänger | `ALERT_EMAIL` → persönliche Adresse |
|
||||
|
||||
## Checkliste
|
||||
|
||||
### Postfächer auf 0012.de
|
||||
|
||||
- [ ] Postfach `monitor@0012.de` (oder `alerts@0012.de`) anlegen
|
||||
- [ ] Passwort in `.env` → `SMTP_USER`, `SMTP_PASSWORD`
|
||||
- [ ] `ALERT_EMAIL` auf persönliche Adresse setzen
|
||||
- [ ] `SMTP_FROM=monitor@0012.de` setzen
|
||||
- [ ] Test: Webmail-Login auf `ha01s019.org-dns.com`
|
||||
- [x] `admin@0012.de` mit Aliasen `monitor@`, `alert@`
|
||||
- [x] Passwort in `.env` → `SMTP_USER`, `SMTP_PASSWORD`
|
||||
- [x] `ALERT_EMAIL` gesetzt
|
||||
- [x] `SMTP_FROM=monitor@0012.de`
|
||||
- [x] Webmail-Login auf `ha01s019.org-dns.com`
|
||||
|
||||
### SMTP für Skripte
|
||||
### SMTP für Skripte (0012.de)
|
||||
|
||||
- [ ] Port 587 + STARTTLS testen (von lokalem Rechner / boka)
|
||||
- [ ] SPF für `0012.de` in Plesk DNS prüfen/setzen
|
||||
- [ ] DKIM in Plesk aktivieren (Deliverability)
|
||||
- [ ] DMARC optional: `_dmarc.0012.de` mit `p=none` zum Start
|
||||
- [x] `config/mail.php` — `sendMail()`, `sendAlert()`
|
||||
- [x] `scripts/test-mail.php` — CLI-Test
|
||||
- [x] Port 587 + STARTTLS getestet (`php scripts/test-mail.php` → OK)
|
||||
- [x] SPF gesetzt (Hoster-DNS)
|
||||
- [x] DKIM in Plesk aktiviert
|
||||
- [ ] DKIM in **öffentlicher DNS** — fehlt; Hoster per Ticket (kein DNS-Zugang im Paket)
|
||||
- [x] DMARC vorhanden (Hoster-DNS)
|
||||
|
||||
### Relay von boka (später)
|
||||
### Technische Notizen
|
||||
|
||||
- [ ] Entscheiden: dediziertes Relay-Postfach `relay@0012.de` vs. App-spezifische Absender
|
||||
- [ ] In Plesk: ausgehende Mail-Limits / Relay-Regeln prüfen (Hoster-Doku)
|
||||
- [ ] boka-Apps: zentraler SMTP-Block in Docker/env (Host, Port, User, Pass)
|
||||
- **Envelope vs. From:** SMTP-Login als `admin@`, `MAIL FROM` ebenfalls `admin@`; sichtbarer Absender bleibt `monitor@` (Alias). Plesk verwirft sonst oft still nach `250 OK`.
|
||||
- **Test lokal:** `php scripts/test-mail.php` (liest `.env`)
|
||||
- **Test vom Webspace:** `mail-test.php?token=…` (liest `private/server.env`)
|
||||
- **Tuta/strenge Empfänger:** bis DKIM-DNS steht → `ALERT_EMAIL` Gmail o. ä.
|
||||
- **Kein DNS-Zugang:** DKIM-Records aus Plesk Mail-Einstellungen an wint-Support — siehe [`../HOSTING.md`](../HOSTING.md#dns-zugang-classic-10)
|
||||
|
||||
### Cron-Benachrichtigungen Plesk
|
||||
## `.env` (Beispiel)
|
||||
|
||||
- [ ] Geplante Aufgaben: „Nur Fehler“ für PHP-Fatal-Errors — ergänzt App-eigene Alerts, ersetzt sie nicht
|
||||
```env
|
||||
SMTP_USER=admin@0012.de
|
||||
SMTP_FROM=monitor@0012.de
|
||||
ALERT_EMAIL=you@example.com
|
||||
```
|
||||
|
||||
## Test
|
||||
|
||||
```bash
|
||||
php scripts/test-mail.php
|
||||
```
|
||||
|
||||
Nach Deploy: `server.env` auf Server, Test lokal mit `.env`.
|
||||
|
||||
## Akzeptanzkriterien
|
||||
|
||||
- Testmail von PHP (`mail()` oder PHPMailer) an `ALERT_EMAIL` kommt an
|
||||
- SPF/DKIM ohne Hard-Fail in Mail-Header-Test (mail-tester.com o. ä.)
|
||||
- [x] Testmail an `ALERT_EMAIL` kommt an
|
||||
- [ ] SPF/DKIM ohne Hard-Fail (mail-tester.com o. ä.) — optional
|
||||
|
||||
## Referenz
|
||||
|
||||
- [`../HOSTING.md`](../HOSTING.md) — SMTP-Host `ha01s019.org-dns.com`
|
||||
- [`../HOSTING.md`](../HOSTING.md)
|
||||
- [`../config/mail.php`](../config/mail.php)
|
||||
- boka-Relay: [`11-boka-smtp-relay.md`](11-boka-smtp-relay.md)
|
||||
|
||||
Reference in New Issue
Block a user