Software & SaaSGuide

When one email provider stops delivering login codes, your staff are locked out. A one-line backup that kept them working.

Email codes are the most common second step at sign-in, and the most fragile. When the mailbox provider has a bad day, a secure login turns into a locked door. The fix is not a weaker login, it is a second way to receive the code.

Author

CrpyByte Engineering

Published

Reading time

2 min read

Two business applications we look after send a one-time code by email at every sign-in. In mid-November 2026, codes sent to addresses at one large webmail provider stopped arriving. Our mail server handed them over normally. The provider simply did not deliver them for more than a day.

For the staff whose login addresses were on that provider, the result was simple: no code, no access, in the middle of a working week.

The quick fix: send the code to a second inbox too

The affected users each had a second address with a different provider. The obvious move would be to change their login email in the database. We did not, for a practical reason: both apps look users up by their exact email address in several places, such as password reset and the admin list of who may receive security codes. Changing the stored address would have broken those lookups in ways that are hard to see until someone needs them.

Instead we added one line just before the code is sent: when the recipient is one of the affected addresses, the message also goes to that user's backup address. Nothing about the user changes, and only sign-in and security-code emails are affected.

// LOGIN_CODE_BACKUP: also send login codes to the user's second inbox.
// Anchored match, so a similar-looking address is not caught.
$to = preg_replace('/^(user@primary-provider\.example)$/i', '$1, user.backup@second-provider.example', $to);
mail($to, $subject, $body, $headers);

Three details made it safe: the pattern is anchored, so only the exact address matches; it runs only for code and security-alert emails, never newsletters or invoices; and the line carries a tag in a comment, so it can be found and removed in seconds. Staff were signing in again the same day.

The real fix: design sign-in with two ways in

The quick fix works for a handful of known users. For any application where people must be able to sign in every day, the second channel should be part of the design:

  • Offer an authenticator app (time-based codes) as the main second step. It works with no email or phone signal at all.
  • Let users register a backup email or phone for codes, on a different provider from the main one.
  • Issue recovery codes at sign-up, to be stored somewhere safe, for the day every other channel fails.
  • Give admins a controlled bypass: a logged, time-limited way to let one named user in, rather than turning the second step off for everyone.
  • Watch delivery, not just sending. A sudden rise in users requesting a new code, or codes requested but never used, is the earliest sign that a provider is dropping them.

A five-minute check of your own apps

  1. List the apps your team signs in to with an emailed code.
  2. For each, note which email providers your staff use for those logins. If most share one provider, that provider is a single point of failure.
  3. Check whether each app supports an authenticator app or recovery codes, and whether anyone has set them up.
  4. Decide who can let a locked-out user in, and how that is recorded.

If your team relies on emailed codes and you want sign-in that survives a provider outage, talk to us. It is usually a small change to an existing app, not a rebuild.

Written by

CrpyByte EngineeringEngineering team

The team that designs and builds CrpyByte client systems and tools. We write about the parts of the work worth writing down.

Have a process worth improving?

Let's build the system behind it. Tell us what the process is and where it breaks — the first conversation is about constraints, not technology.