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:
Frank Schwenk
2026-06-11 23:19:03 +02:00
parent 04e1455d9f
commit 01de7ed4fb
16 changed files with 543 additions and 41 deletions
+39
View File
@@ -0,0 +1,39 @@
#!/usr/bin/env php
<?php
declare(strict_types=1);
/**
* Send a test mail using local .env (this machine only).
* Usage: php scripts/test-mail.php
*/
$root = dirname(__DIR__);
require_once "{$root}/config/mail.php";
$to = env('ALERT_EMAIL');
if (!$to) {
fwrite(STDERR, "ALERT_EMAIL not set in .env\n");
exit(1);
}
$from = env('SMTP_FROM', env('SMTP_USER'));
$domain = env('DOMAIN', '0012.de');
$subject = "[{$domain}] SMTP test (local) " . gmdate('Y-m-d H:i:s') . ' UTC';
$body = implode("\n", [
'0012.de SMTP test — sent from local machine',
'',
'From header: ' . $from,
'SMTP auth: ' . env('SMTP_USER'),
'',
'If you receive this, local SMTP settings work.',
]);
try {
sendMail($to, $subject, $body);
echo "Sent test mail to {$to} (From: {$from})\n";
} catch (Throwable $e) {
fwrite(STDERR, 'Failed: ' . $e->getMessage() . "\n");
exit(1);
}