Files
selfpost/deploy/.env.example
T
mixandClaude Opus 5.5 bdeb01681d local-time: the panel in the container's zone, named on Settings
Agreed by the owner on 2026-10-13 (the local day, no "UTC" beside a
time); the zone is the container's TZ in .env and Settings only shows it,
his "Да" of 2026-10-17. Mockups c205106.

Every time the panel shows is formatted in time.Local and says no zone:
the logs' Time and the DMARC Received columns, a message's timeline,
Overview's "Updated", Health's certificate and renewal, the filter lists,
DMARC reports and windows, the auto limit's last recalculation. Stored
instants stay UTC. The days counted are the zone's: delivery_log_days and
sender_check_days key their rows by the local date, the sender check cuts
downtime at local midnights (byDay), the log filters' days run from local
midnight to local midnight. Notification mail and the test message write
the zone's abbreviation after a time - they are read away from the panel.
DMARC's one-day window label stays the reporter's (UTC) day.

Settings box 05, Time zone, read-only: the name (UTC without TZ), its
offset, and a TZ the image cannot load said to leave the times in UTC
(time/zoneinfo_unix.go, initLocal) rather than named. TZ is passed by the
compose file ("${TZ:-}"), in .env.example and the guide's table; tzdata is
named in the image (supervisor's python3.13 brings it today). Postfix
takes TZ through import_environment, so mail.log's stamps are the same
zone, which closes the trap the roadmap wrote down: the tailer has always
read them in time.Local.

Tests: a TestMain runs view, handlers, store and cmd/panel in UTC whatever
the machine's zone (as logtail's); TestSettingsShowsTheTimeZone,
TestTimesAreTheContainersZone, TestByDayInTheContainersZone, a Moscow day
in TestQueryInboundSpamFilters; envdoc's pattern takes two-letter names.
e2e time_zone_is_the_containers recreates the stand with
TZ=Europe/Moscow: date says MSK, Settings names the zone and UTC+03:00, a
test message's page gives its time and its mail.log lines in Moscow's.
go vet + go test (26 packages) and make e2e on the test server for this
tree.

Docs: guide (§ Settings, the TZ row, the days of Health and the logs),
architecture, schema-migrations, help (word for word with the mockup),
CHANGELOG [Unreleased] § Added, roadmap row done with the decision.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 01:34:28 +03:00

76 lines
3.5 KiB
Bash

# Copy to .env next to docker-compose.yml and fill in.
# Full reference: docs/guide.md "Environment variables".
# Required — the container refuses to start without it. Hostname used both for
# the panel's TLS vhost and for Postfix's SASL realm (SASL_REALM defaults to
# this) and myhostname; must also match your PTR record. Must match the
# certificate your reverse proxy obtains. Bare FQDN only — no scheme or port.
SELFPOST_HOSTNAME=mail.example.com
# Set to true to also enable RFC 6409 submission (587/STARTTLS) alongside the
# primary 465/smtps listener.
SUBMISSION_ENABLE=false
# Optional inbound relay (backup-MX / forwarder). When true, Postfix accepts
# mail on port 25 only for domains configured in the panel and forwards them
# to the upstream you set. Off by default — the outbound path is unchanged.
INBOUND_RELAY_ENABLE=false
# Optional DMARC aggregate report ingest. When true, Postfix accepts mail on port
# 25 only for report addresses configured in the panel (global default and/or
# per-domain SelfPost-hosted addresses) and pipes them to the ingest worker.
DMARC_REPORTS_ENABLE=false
# Coarse per-client-IP limit and message size for DMARC ingest on port 25.
# DMARC_RATE_LIMIT_MESSAGES_PER_IP=20
# DMARC_MESSAGE_SIZE_LIMIT=5242880
# Optional milter on the inbound listener only (not 465/587). Empty = off.
# Example with deploy/antispam/docker-compose.antispam.yml:
# INBOUND_ANTISPAM_MILTER=inet:antispam:11332
# INBOUND_ANTISPAM_MILTER_ACTION=accept
# Days the inbound journal keeps a row (7-365) until the panel says otherwise;
# it never holds more than 10 000 rows.
# INBOUND_SPAM_LOG_RETENTION_DAYS=90
# Coarse per-client-IP limit and message size on inbound smtpd (port 25).
# INBOUND_RATE_LIMIT_MESSAGES_PER_IP=20
# INBOUND_MESSAGE_SIZE_LIMIT=26214400
# Level-1 backstop rate limit (anvil) — see docs/guide.md "Rate limiting".
RATE_LIMIT_MESSAGES_PER_IP=100
RATE_LIMIT_WINDOW_SECONDS=3600
# Days of send-log history kept before the background sweep deletes rows.
SEND_LOG_RETENTION_DAYS=90
# Sliding idle timeout for the panel login session, in days. No absolute cap:
# an admin who keeps coming back stays signed in indefinitely. Polling by the
# monitoring screens does not count as activity, only navigation/actions do.
PANEL_SESSION_IDLE_DAYS=7
# Comma-separated resolvers the panel's deliverability checks (PTR, SPF, DKIM,
# DMARC) query directly. They deliberately skip this host's own resolver: with
# systemd-resolved the reverse lookup of the server's IP answers with the local
# hostname instead of the PTR record published in public DNS, which made the
# panel report a correct PTR as wrong. Leave unset for the public defaults
# (1.1.1.1, 8.8.8.8, 9.9.9.9); set it if outbound port 53 is closed or you run
# your own recursor, e.g. SELFPOST_DNS_RESOLVERS=10.0.0.2:53
# SELFPOST_DNS_RESOLVERS=
# Time zone of the container, an IANA name: every time the panel shows, the
# days it counts (today on Health, the days of the statistics, the log
# filters) and the stamps Postfix writes in mail.log. Leave unset for UTC;
# changing it is a restart. Server > Settings shows the zone in use.
# TZ=Europe/Moscow
# Comma-separated CIDRs (bare IPs allowed) of reverse proxies allowed to
# supply X-Forwarded-For for login/setup rate-limiting. Leave unset unless
# you know the exact address of your reverse proxy — trusting the wrong
# source lets a client spoof its rate-limit key. Behind the default Apache
# host-network setup this is typically the Docker bridge gateway, e.g.
# TRUSTED_PROXY_CIDR=172.18.0.1