A mail server is two quite different products wearing one name, and until
now LibrePortal only offered the hard one. Installing Stalwart meant being
handed a wall of DNS records, a red error about port 25 and a warning about
reverse DNS — all of it correct, none of it fixable by the installer, and
most of it irrelevant to someone who wanted mailboxes and a shared calendar
on their own network.
CFG_STALWART_MODE now names which one you are running:
private mailboxes, IMAP, CalDAV and CardDAV on your own network. Port 25
is not published at all; the client ports stay bound to the host
but are never opened through the firewall. No MX, no PTR, no
deliverability. Nothing to publish, so nothing is printed.
public the internet mail server, as before.
auto public if Traefik is installed, private if not, resolved at
install and written back so it reads as a real answer afterwards.
DKIM keys are generated in both modes even though private has no use for
them today — that is what makes switching later a setting change rather
than a key ceremony. The WebUI gets a "Mail Exposure" tool that flips the
setting both ways and reconfigures the server, plus a "Show DNS Records"
tool that prints the live zone including current DKIM keys.
Two things this had to get right, both found by testing rather than
reading. Port access lives in the shell as CFG_<APP>_PORT_n, not just in
the config file, and the compose file is built from the parsed shell
values — editing only the file left the config claiming port 25 was
disabled while the container published it anyway. And going public needs
an AcmeProvider to exist before a domain can reference one, so the switch
creates it; note that doing so registers an account with Let's Encrypt.
Verified through real installs: auto resolves to private with no Traefik,
port 25 is genuinely unpublished and absent from the compose file, the
client ports are skipped by the firewall as host-bound, and the tool
round-trips private -> public -> private with the config landing back
exactly where it started.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
33 lines
908 B
JSON
33 lines
908 B
JSON
{
|
|
"tools": [
|
|
{
|
|
"id": "set_mode",
|
|
"category": "system",
|
|
"label": "Mail Exposure",
|
|
"description": "Switch between a private mail + calendar server and a real internet mail server.",
|
|
"icon": "📬",
|
|
"fields": [
|
|
{
|
|
"name": "mode",
|
|
"label": "Who is this mail server for?",
|
|
"type": "select",
|
|
"required": true,
|
|
"default": "private",
|
|
"options": [
|
|
{ "value": "private", "label": "Private — local network only, no internet mail" },
|
|
{ "value": "public", "label": "Public — exchange mail with the internet" }
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "show_dns",
|
|
"category": "system",
|
|
"label": "Show DNS Records",
|
|
"description": "Print the records this domain needs, including the live DKIM keys.",
|
|
"icon": "🌐",
|
|
"fields": []
|
|
}
|
|
]
|
|
}
|