Blog · SMS Forwarder

How to forward 2FA codes from your iPhone

Illustration of a lock screen where bank verification codes are forwarded automatically to Telegram, email and Slack

To forward 2FA codes from your iPhone, set up SMS Forwarder with a private destination such as your own email or a Telegram chat, then turn on the “Forward verification codes” filter so only texts that look like codes leave the phone. Before you do, be clear about what you’re trading. SMS codes are the weakest common form of two-factor login, and forwarding puts a copy somewhere else. Done carefully, it’s still a sensible fix for a real annoyance.

When does forwarding codes make sense?

Forwarding makes sense when the code arrives on one device and you need it on another. The classic case is a laptop at your desk while the phone charges in another room, or a work computer where you can’t have your personal phone out. Every login becomes a walk to fetch the phone. With forwarding, the code shows up in an inbox or a chat you already have open.

The other case is a second person. A partner who pays the household bills, or an assistant who logs in to a service registered to your number, may need codes that only you receive. That can be fine, within one rule we’d hold to firmly: only forward codes to someone you’d give the account to anyway. Services that say “never share this code” mean it, because anyone holding the code can use it.

Forwarding is a poor fit for accounts where you’re the only person who should ever get in and the phone is always with you. There’s nothing to gain there, and a copy elsewhere is pure exposure.

SMS codes are the weak second factor

SMS is the least secure of the common second factors, and that’s well established. Codes can be stolen by moving your number to an attacker’s SIM (a SIM swap), by a phishing page that asks you to type the code, or through weaknesses in the phone network. NIST’s digital identity guidelines treat SMS-based authentication as a “restricted” method for these reasons.

Authenticator apps and passkeys avoid most of that, so wherever a service offers them, we’d switch to them and stop relying on texts. Forwarding is for the accounts that offer nothing but SMS, which still includes some banks and plenty of older sites.

Forwarding also adds one risk of its own. The code now exists in two places, and the second place has its own password and its own security.

Filtering so only codes leave the phone

The “Forward verification codes” filter is a one-tap regex in the app’s filter list, added in version 1.5. Once it’s in the list, a text is forwarded only if its body contains something the pattern matches. Everything else is dropped on the iPhone before it’s encrypted or sent, so personal texts never reach our server and don’t use your free forwards.

SMS Forwarder’s Filters screen with the Forward verification codes regex added, a Keyword and Regex switch, and a filter list with keywords and regex entries
The Filters screen, with the one-tap verification-code pattern at the top. From our App Store screenshots.

The pattern is (?<!\d)(\d{4}|\d{6})(?!\d). In plain words: a run of exactly four or exactly six digits that has no other digit directly before or after it.

What the pattern catches

It catches the usual shapes: “Your code is 4821”, “482913 is your verification code”, “Code:482913”. Letters and punctuation next to the number are fine, because the pattern only cares that the neighbors aren’t digits, so “G-482913” passes too.

What it misses, and what slips through

It misses codes of other lengths. A 5-digit, 7-digit or 8-digit code won’t match. Neither will a code split by a space or hyphen, like “482 913” or “482-913”, since each half is only three digits. Letter-and-number codes such as “A7K9Q2” don’t match either.

It also lets through things that aren’t codes. A bank text ending “card ending 4417” matches, and so does any message with a year in it, like “your appointment on 3 March 2027”. For most people that’s an acceptable amount of noise. Still, if the goal is “only codes, nothing else,” know that it’s a close approximation and nothing more.

Adding keywords alongside the regex

Any match forwards the message, so you can add keywords next to the regex to catch what it misses. A keyword like “code” or “OTP”, or the word your bank uses in your language, picks up an 8-digit code as long as the text contains that word. Matching ignores case and accents, so “Code” and “CODE” behave the same.

The catch is breadth. “Code” also matches “use discount code SPRING”, so every keyword you add lets in more than codes. Filters are global, and they read only the message body. You can’t say “codes from this sender only”, because the sender isn’t part of the match. The filters guide has a few more patterns, including one for split codes.

Choosing where the codes go

Codes should go to a place only you can read. In SMS Forwarder that usually means your own email address or your Telegram chat with the SMS Forwarder Bot, set up as described in forwarding SMS to Telegram. A Custom API endpoint is fine too, if you run the server yourself.

Avoid shared team channels for personal codes. A text forwarded to Slack, Discord or Teams can be read by everyone in that channel, including people who join later and scroll back.

One trap is easy to miss. Don’t forward the codes for your email account to that same email account. If someone gets into the mailbox, they’d see the code that was meant to stop them, and many password resets go through email anyway. Send those codes somewhere else, or better, protect the email account with an authenticator app.

Whatever you pick, give that account strong protection of its own. The forwarded code is only as safe as the place it lands.

What our server sees

Each text is encrypted on the iPhone with a fresh AES-256-GCM key before it’s sent. Our server has to open it to deliver it, so this is encryption from your phone to us and not all the way to your inbox. The decrypted text lives in memory only during delivery and is then discarded. The app’s History keeps a masked preview of at most 15 characters with only the first two visible, so a code like “Your code is 482913” is stored as “Yo” and asterisks. The security page explains the full chain.

Limits that matter for codes

Codes expire, so these limits are worth knowing before you count on forwarding:

  • The iPhone must be online when the code arrives. There’s no offline queue. A code that lands while the phone has no connection isn’t forwarded later, and by then it would have expired anyway.
  • The automation has to run without asking. If “Run Immediately” isn’t set, iOS asks you to confirm each time, and the code sits on the phone until you tap.
  • Only incoming texts are forwarded. Codes sent by voice call aren’t.
  • You can’t reply from the destination.

Set it up

If you haven’t built the automation yet, the Shortcuts automation guide takes about five minutes. Then add your destination, add the “Forward verification codes” filter, and ask someone to text you a message containing a 6-digit number. The app is on the SMS Forwarder page.

Questions

Frequently asked

Is it safe to forward 2FA codes?

It's a trade-off. Every extra place a code lands is another place it could leak, and text-message codes are already the weakest common second factor. Keep the destination private, and move accounts to an authenticator or a passkey when the service lets you.

Will 8-digit codes pass the verification code filter?

Not with that pattern alone, since it accepts runs of exactly four or six digits. Add a second regex for longer numbers, or a keyword that those messages always contain.

Can I forward codes from only one bank?

No. The filter list applies to every rule and reads what the message says, not who sent it. A keyword that only ever appears inside that bank's texts, such as its name, is the closest workaround.

Can another person receive my verification codes?

Yes, if you add their email address as a rule. Only do that for accounts you'd hand them the password to anyway, because a forwarded code is as good as the person holding it.

Guide

Forward SMS to WhatsApp with Shortcuts

Forward SMS to WhatsApp on iPhone by adding WhatsApp's Send Message action to the SMS Forwarder automation. Steps, recipients, and why it's less reliable.