v0.40.0¶
Release Date: 2026-11-28
Email sign-in lets anyone who can reach the sign-in page make SystemAuth send mail. The address and client limits bound what one address or one client can cause, but not what many clients together can. This release adds a budget for the whole deployment's sign-in mail: when it runs out, sign-in mail stops until an operator has looked, and the operator is alerted by mail and by a Slack or Discord webhook (ADR-025).
A budget for sign-in mail¶
mail:
sign_in_budget:
per_hour: 20
per_day: 60
alert:
email: [[email protected]]
webhook_url: ${SYSTEMAUTH_ALERT_WEBHOOK_URL}
- What counts. Email sign-in codes, and the links that verify a provider email during a social sign-in. A message counts only when the address and client limits let it through. Mail to signed-in people, such as an email change, is not counted.
- When it runs out. The message is not sent and sign-in mail halts. The
sign-in page leaves out Email, the email pages answer
503and point to the other methods, discovery leavesemailout ofsf_sign_in_methods_supported, and a social sign-in that needs its email verified by mail is refused. Social sign-in with a verified email, existing sessions and other mail keep working. - It stays halted. A halt is kept in the database, survives restarts, and
does not lift when the window rolls over.
systemauth mail halt statusshows it;systemauth mail halt clear --by <name>lifts it, records who did, and running instances resume within 30 seconds with the budget reset. - One alert per halt. To each
alert.emailaddress, through the deployment's mail sender and outside the budget, and toalert.webhook_url, a Slack or Discord incoming webhook chosen by the URL (through omnichat'snotify). An alert names the window, the budget, the time and the clear command, never an address or a code. A budget without an alert destination fails validation. - Security events
systemauth.mail.halted(OCSF Application Lifecycle, Disable, High) andsystemauth.mail.resumed(Enable).
Without sign_in_budget, nothing changes.
See A budget for the whole deployment.
For hosts¶
WithMailHaltHandleris told of each halt, for an application that alerts another way.WithMailHaltStoresets where halts are kept.EntMailHaltStoreis the default with Ent storage;MemoryMailHaltStoreotherwise, which forgets a halt on restart.- Package
identity/systemauth/mailcmdprovides themail halt statusandmail halt clearcommands for a host CLI to mount, assignupcmddoes for invites.
Upgrading¶
- Run the schema migration (
systemauth migrate, orsystemauthsvc.Migrate) for the newsf_mail_haltstable. A service started without migrations refuses to start until it has run. - Choose the numbers above your real peak of sign-in mail, from
systemauth.email_code.sentevents, and below your mail provider's quota, so a halt comes before the quota is gone. - Keep the webhook URL in the environment. It is a credential; errors never include it.
- Relying parties read discovery at startup, so an application's own Email button can stay while sign-in mail is halted. It leads to SystemAuth's page, which explains and offers the other methods.
Dependencies¶
github.com/plexusone/omnichatv0.9.0, for itsnotifypackage.