fix(mail): claim inbound IPv6 (2a01:4f8:c012:9d85::2) so IMAP/MX over v6 work; pin Postfix outbound to v4 #97
Labels
No labels
bug
enhancement
in-progress
needs-info
needs-triage
p0
ready-for-agent
ready-for-human
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/nixos#97
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
FreeScout (
support.cloonar.dev, hosted on web-arm) fails to connect to IMAP:Root cause:
imap.cloonar.com/mail.cloonar.compublish an AAAA record2a01:4f8:c012:9d85::2, but the mail host never configures that address. Confirmed live via the read-only diag channel onmail:enp1s0carries only91.107.201.241/32+ link-localfe80::9400:2ff:fe23:b445/64— no global IPv6.ip -6 routeshows onlyfe80::/64— no default v6 route.[::]:993(and 25/143/389/465/587/636 on[::]:*).So inbound v6 SYNs to
[2a01:4f8:c012:9d85::2]:993reach mail's link but the host doesn't own the address → packets are black-holed ("timed out", not "refused").Why it regressed now: when web-arm gained outbound IPv6 (ADR 0010 / #81), RFC 6724 made it prefer the v6 destination for
imap.cloonar.com. PHP'sstream_socket_client()(webklex/php-imap) has no happy-eyeballs / no v6→v4 fallback, so it connects to::2and hangs. Inbound MX-over-v6 to mail is broken for the same reason.Fix (coupled — both land in one PR)
1.
hosts/mail/configuration.nix— claim the published AAAA + standard Hetzner gateway (mirrors web-arm; interface confirmed asenp1s0):2.
hosts/mail/modules/postfix.nix— pin outbound to IPv4:Rationale: mail's v6 address has no PTR and is in no sending domain's SPF. Without the pin, Postfix (default
any) would prefer the v6 source to dual-stack MXes (Gmail/Microsoft) → spam-filed. The pin keeps outbound delivery exactly as today (over IPv4).Dovecot needs no change — it already listens on
[::]:993; claiming::2is sufficient.Decisions (settled with maintainer)
::2in Hetzner and adding::2to the SPF of every sending domain (cloonar.com, optiprot.eu, superbros.tv, szaku-consulting.at, scana11y.com, macher.solutions, fueltide, docfast.dev).::2is up, the family-agnostic firewall makes every open port reachable over v6 too — including LDAP 389/636. Explicitly accepted (it mirrors the existing v4 exposure; scoping LDAP to wireguard is out of scope here).Docs
Verification
2a01:4f8:c012:9d85::2+enp1s0against the Hetzner console before merge.ip -6 routeshowsdefault via fe80::1 dev enp1s0.[2a01:4f8:c012:9d85::2]:993connects (and FreeScout fetches mail).postconf smtp_address_preference→ipv4.Received:header).Refs
enp1s0), missing global v6, and Dovecot's[::]:993listener all confirmed via the read-only diag channel onmail.