Skip to content

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 503 and point to the other methods, discovery leaves email out of sf_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 status shows 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.email address, through the deployment's mail sender and outside the budget, and to alert.webhook_url, a Slack or Discord incoming webhook chosen by the URL (through omnichat's notify). 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) and systemauth.mail.resumed (Enable).

Without sign_in_budget, nothing changes.

See A budget for the whole deployment.

For hosts

  • WithMailHaltHandler is told of each halt, for an application that alerts another way.
  • WithMailHaltStore sets where halts are kept. EntMailHaltStore is the default with Ent storage; MemoryMailHaltStore otherwise, which forgets a halt on restart.
  • Package identity/systemauth/mailcmd provides the mail halt status and mail halt clear commands for a host CLI to mount, as signupcmd does for invites.

Upgrading

  • Run the schema migration (systemauth migrate, or systemauthsvc.Migrate) for the new sf_mail_halts table. 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.sent events, 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/omnichat v0.9.0, for its notify package.