v0.89.0: app-email plaintext-only listener (:2526) + split-From mapping

Gap 1: third shim listener :2526, plaintext, does NOT advertise STARTTLS (TLSConfig
nil) — for opportunistic-STARTTLS clients with no cert-skip (cal.com, nextcloud).
Gap 2: SMTPMapping tls_mode (picks port 2525/2526/2465) + from_domain_var (split
local-part + domain for nextcloud's MAIL_FROM_ADDRESS/MAIL_DOMAIN). Default keeps
existing apps on 2525. Hub untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-29 13:13:40 +02:00
parent 6692a2f631
commit a405505e81
8 changed files with 252 additions and 47 deletions
+12 -10
View File
@@ -40,11 +40,12 @@ type Config struct {
type MailRelayConfig struct {
// Enabled is a hard kill-switch: false disables the shim regardless of the runtime
// toggle. nil/true → the runtime app-email toggle decides. (Operational override only.)
Enabled *bool `yaml:"enabled"`
PlainListen string `yaml:"plain_listen"` // plaintext+STARTTLS, default ":2525"
TLSListen string `yaml:"tls_listen"` // implicit-TLS, default ":2465"
ShimHost string `yaml:"shim_host"` // app-network DNS name of the controller; default "felhom-controller"
FromDomains []string `yaml:"from_domains"` // From-header allowlist; default ["felhom.eu"]
Enabled *bool `yaml:"enabled"`
PlainListen string `yaml:"plain_listen"` // plaintext+STARTTLS, default ":2525"
TLSListen string `yaml:"tls_listen"` // implicit-TLS, default ":2465"
PlainNoTLSListen string `yaml:"plain_no_tls_listen"` // plaintext-only, no STARTTLS, default ":2526"
ShimHost string `yaml:"shim_host"` // app-network DNS name of the controller; default "felhom-controller"
FromDomains []string `yaml:"from_domains"` // From-header allowlist; default ["felhom.eu"]
}
// HardEnabled reports the operational kill-switch (default on unless explicitly false).
@@ -66,7 +67,7 @@ type LocalAPIConfig struct {
// backup. Runs only when the local API is configured (a provisioned guest). MaxQuiesce bounds the
// app downtime — the controller unquiesces no matter what once it elapses.
type QuiesceConfig struct {
Enabled *bool `yaml:"enabled"` // nil/true → on when local API configured; false → off
Enabled *bool `yaml:"enabled"` // nil/true → on when local API configured; false → off
PollInterval string `yaml:"poll_interval"` // /backup/due check cadence (default "5m")
StatusPoll string `yaml:"status_poll_interval"` // /backup/status poll while quiesced (default "10s")
MaxQuiesce string `yaml:"max_quiesce_duration"` // hard downtime bound (default "30m")
@@ -103,7 +104,7 @@ type PathsConfig struct {
type WebConfig struct {
Listen string `yaml:"listen"`
SetupListen string `yaml:"setup_listen"` // Plain HTTP listener for setup wizard (only active during setup mode)
SetupListen string `yaml:"setup_listen"` // Plain HTTP listener for setup wizard (only active during setup mode)
PasswordHash string `yaml:"password_hash"`
SessionSecret string `yaml:"session_secret"`
}
@@ -185,9 +186,9 @@ type LoggingConfig struct {
}
type AssetsConfig struct {
SourceURL string `yaml:"source_url"` // Only used during build, not runtime
SyncEnabled bool `yaml:"sync_enabled"` // Download assets from Hub API
SyncSchedule string `yaml:"sync_schedule"` // Daily sync time (HH:MM), default "05:00"
SourceURL string `yaml:"source_url"` // Only used during build, not runtime
SyncEnabled bool `yaml:"sync_enabled"` // Download assets from Hub API
SyncSchedule string `yaml:"sync_schedule"` // Daily sync time (HH:MM), default "05:00"
}
type HubConfig struct {
@@ -320,6 +321,7 @@ func applyDefaults(cfg *Config) {
d(&cfg.Quiesce.MaxQuiesce, "30m")
d(&cfg.MailRelay.PlainListen, ":2525")
d(&cfg.MailRelay.TLSListen, ":2465")
d(&cfg.MailRelay.PlainNoTLSListen, ":2526")
d(&cfg.MailRelay.ShimHost, "felhom-controller")
if len(cfg.MailRelay.FromDomains) == 0 {
cfg.MailRelay.FromDomains = []string{"felhom.eu"}