import { useSession } from "@/store/session"; import { client } from "@/jmap/client"; import { DEFAULT_SOURCE_URL } from "@/lib/source"; import { APP_VERSION } from "@/lib/version"; import { withBase } from "@/lib/basePath"; import { t, tNode } from "@/lib/i18n"; export function AboutSettings() { const session = useSession((s) => s.session); const caps = Object.keys(session?.capabilities ?? {}); // A deployment running modified code should offer its own source, not ours. const sourceUrl = session?.ihasmail?.sourceUrl ?? DEFAULT_SOURCE_URL; return (

{t("About ihasmail")}

{tNode("A fast, friendly, open-source webmail for {server}, built on JMAP.", { server: {t("Stalwart Mail Server")} })}

{t("ihasmail")}
{/* A product name and a version string: neither is a word to translate. */}
ihasmail v{APP_VERSION}
{tNode("AGPL-3.0-or-later · {source}", { source: {sourceUrl.replace(/^https?:\/\//, "")} })}

{t("Server")}

{t("Signed in as")}{session?.username}
{t("Stalwart")}{describeServer(session?.ihasmail?.server)}
{t("Accounts")}{Object.values(session?.accounts ?? {}).map((a) => a.name).join(", ")}
{t("Max upload")}{t("{size} MB", { size: Math.round(client.maxSizeUpload / 1048576) })}
{t("Image privacy proxy")}{session?.ihasmail?.imageProxy ? t("enabled") : t("disabled")}

{t("Stalwart does not publish its version number to mail clients, so ihasmail reports the edition where the server gives one. ihasmail requires 0.16 or newer, and sign-in refuses anything older.")}

{tNode("ihasmail's own version is the date of the commit it was built from, followed by where that commit came from: {example} was built from a commit dated the 30th of August 2026 that arrived through pull request 129. A commit that did not come through one carries its short SHA instead — {sha}. The version deliberately says nothing about Stalwart; what this build needs from the server is the line above.", { example: v2026.8.30+pr129, sha: +g1fa6578 })}

{t("Server capabilities")}

{caps.map((c) => {c.replace("urn:ietf:params:jmap:", "")})}
); } /** * Stalwart deliberately withholds its version from clients (it reports a fixed * "1.0.0" wherever it publishes one at all), so the edition is all there is to * show. The generation used to be reported here too, back when ihasmail spoke * to both 0.15 and 0.16; it requires 0.16 now, so signing in at all is the * answer to that question. */ function describeServer(server: { edition?: string | null } | undefined): string { return server?.edition ? `0.16 or newer (${server.edition})` : "0.16 or newer"; }