Repository navigation
mail-auth-proxy 0.4.0
·
27 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
Added
- A profile per backend (
imap.backend,submission.backend,sieve.backend), every key
reloadable:tls = "starttls" | "implicit": how the proxy secures its connection to the backend.
IMAP can now use STARTTLS (RFC 9051 §6.2.1: the capabilities are asked anew over
TLS), submission and ManageSieve implicit TLS (RFC 8314). The EHLO and capability
probes take the same way. Defaults as before: IMAP implicit, the others STARTTLS.auth_forward = "xoauth2" | "oauthbearer": the mechanism a validated token is
forwarded with, whichever the client used. OAUTHBEARER (RFC 7628 §3.1) carries the
verified identity as GS2 authzid and the backend's name and port. A failure's error
result is answered with%x01(§3.2.3); astatusofinvalid_requestis an outage,
not a failed login. Defaultxoauth2, as before.client_ip = "proxy_v2" | "xclient" | "none": how the backend learns the client
address. The submission backend can now take a PROXY v2 header (with aLOCALheader
on the EHLO probe);xclientis refused on the other backends. A backend withnone,
set or by default, gives a configuration warning: it sees every client as the proxy.
submission.implicit_tls_listen: a second submission listener with implicit TLS (port
465, RFC 8314 §3.3), next to STARTTLS onsubmission.listen, with the same dialog,
gate and backend. Adding, moving or removing it needs a restart.- The
authresultline gets a last fieldlistener(imap,submission,
submissions,sieve), andmail_auth_proxy_listener_connections_total{listener}and
mail_auth_proxy_listener_auth_attempts_total{listener,result}split connections and
auth attempts by listener. Existing fields, families and labels are unchanged. - Example configurations
examples/config.dovecot-postfix.tomland
examples/config.stalwart.toml(the latter untested, from the Stalwart documentation). - ALPACA hardening for SMTP (RFC 9325 §3.8, RFC 7301 §3.2): on both submission
listeners a client that offers an ALPN ID of another protocol from the IANA registry
(http/1.1,h2,imap, …; GREASE values excepted) is refused before the ServerHello
with the fatal alertno_application_protocol(120); the session-end line says
TLS ALPN "<id>" names another protocol. Without ALPN, or with unregistered values,
nothing changes and no protocol is selected. - Fuzz target
backend_auth: the backend's OAUTHBEARER error result, the ManageSieve
challenge string, the OAUTHBEARER build/parse roundtrip. - Named backends and routes: one endpoint in front of several mail systems.
[backends.<name>]holds a backend profile; a protocol section names it
(backend = "<name>") or[[routes]]choose it per credential. A route takes the
domains of the validated identity (OAuth) or of the login (password), optionally
narrowed by the token'sissuersandaudiencesand the client'ssni; the first
matching route in file order wins,domains = ["*"]takes the rest. The SNI never
selects a backend on its own. A credential no route takes is refused as
unknown_domainwithout backend contact (a password with the wrong-password reply and
delay), with aWARN … no route for the login's domainline and
mail_auth_proxy_route_misses_total{proto}. Routes and backends are reloadable; a
backend that stays keeps its capability cache and refusal timing. The inline
backend = { … }keeps its meaning. - The
authresultline gets a last fieldbackend: the name of the backend the
credential was sent to (the section name for an inline backend), empty when none was.
Earlier fields are unchanged. - With several backends behind a protocol, the SMTP EHLO reply after TLS lists only the
extensions every submission backend offers, with the smallestSIZE, and the
ManageSieve capabilities before AUTHENTICATE are those all its backends have (SIEVE
andNOTIFYnarrowed,MAXREDIRECTSthe smallest). The backends are probed together.
Changed
- The refusal timing of the legacy gate learns the rejection latencies per backend
instead of per protocol. A refusal by the account check or the throttle waits like a
wrong password at the backend the login goes to; a refusal before it (size, rule,
domain, no route) waits for the slowest backend of the protocol. With one backend per protocol
the timing is the same as before; the change keeps refusals and wrong passwords alike
once a protocol has several backends. - The
submission auth okandsieve auth oklog lines, and the IMAP linesoauth validated; proxying to backendandpassword auth; forwarding to backend, name the
issuer of the token (issuer=, empty for a password). - The startup lines
imap listener upand the others name every backend of the protocol
(backends=[<name>=<address>, …]instead ofbackend=<address>); the IMAP login lines
carrybackend=. backend.proxy_protocolandsubmission.xclientare short forms ofclient_ip;
--print-configshowsclient_ip.submission.backend.proxy_protocol = trueis now
accepted (it was an error); combining a short form withclient_ip, or both short
forms, is an error.- The ManageSieve backend login answers an error challenge to a forwarded token (a
string instead of a verdict line) and reads the verdict after it; before, the challenge
line was taken as a rejection and the backend connection dropped. - The log line of a submission backend that advertises XCLIENT to a proxy not set to use
it namessubmission.backend.client_ipinstead ofsubmission.xclient.
Fixed
- The usage text (
-h,--help, an unknown option) lists-hand--help.
Install
Debian and Ubuntu: APT repository, see INSTALL.md.
Other systems: download the package or archive and SHA256SUMS, SHA256SUMS.asc and
release-signing-key.asc, then:
gpg --import release-signing-key.asc # 0B58 3E99 144D CD9B 5A34 D96B E52C 6D1E FB67 927B
gpg --verify SHA256SUMS.asc SHA256SUMS
sha256sum -c --ignore-missing SHA256SUMS