Alerts

E-mail to SMS: alerts from a NAS, a UPS or cron, texted by your own phone

Give a NAS, a UPS, a camera or cron the e-mail address of a webhook, and your own Android phone texts each alert from your number. Nothing to install.

By NARBOWEB SRL, the company behind SMSTunnel Published 4 min read

Plenty of devices can do only one thing when something goes wrong: send an e-mail. A NAS with a failing drive, a UPS running on battery, a camera that saw movement, a printer, a backup job, cron. The e-mail then waits in an inbox until someone looks, which at night can be hours.

A text gets read sooner. So every SMSTunnel webhook can now have an e-mail address: an e-mail sent to it becomes a text to the numbers you saved with that webhook, sent by your own Android phone, from your own number. There is nothing to install on the device. If it can e-mail you today, it can text you.

Set it up in three steps

You need the SMSTunnel app from Google Play on an Android phone, signed in to your account.

  1. In your dashboard, open Apps → Webhooks → New webhook and pick Something that sends e-mail.
  2. Add the numbers that should get the texts, up to 10, and click Create the webhook. The next screen shows the webhook’s e-mail address, which ends in @in.smstunnel.io, with a Copy button.
  3. In the device’s alert settings, add that address as a recipient, the way you would add your own.

On a webhook you already have, open Address and setup and turn on Accept e-mail.

Where the address goes

The names differ a little between versions, so take these as the place to look:

  • Synology DSM: Control Panel → Notification → Email. Set up the sender first, then add the address to a recipient profile and click Send Test Email.
  • QNAP QTS: Notification Center. Add the e-mail account it sends from under Service Account and Device Pairing, then add the address as a recipient of a rule under System Notification Rules.
  • APC UPS with a network card: Configuration → Notification → E-mail → Recipients (Administration instead of Configuration on older firmware).
  • cron: MAILTO at the top of the crontab. cron mails whatever a job prints, so a job that prints only when it fails texts you only then.
  • Monitoring tools such as Zabbix, Nagios or Proxmox: an e-mail contact, media type or notification target with the address.
MAILTO=3f1c0a9be27d44a6b5c8e0f7a1d2c3b4e5f60718293a4b5c@in.smstunnel.io
0 2 * * * /usr/local/bin/nightly-backup.sh

The device still sends e-mail its own way: through its SMTP settings, often your mail provider’s, or through a mail program such as msmtp or Postfix on a server that runs cron.

What the text says

The subject, then the first lines of the e-mail:

Backup failed on nas-01
The nightly backup stopped at 02:14: the destination could not be reached.

A text takes at most 3 SMS parts; a longer e-mail is cut and ends with three dots. Quoted replies and the signature are left out. If you prefer your own words, write the webhook’s text with {{subject}}, {{text}} and {{from}}, for example NAS: {{subject}}.

How it stays safe

  • The address works like a password. Whoever has it can text the webhook’s numbers, and never any other number. If it gets out, New address replaces it at once.
  • An e-mail never chooses who gets the text. The numbers are the ones saved with the webhook; a number written in the e-mail is just words.
  • Only from these senders is an optional list of addresses or whole domains. It also needs the sender’s mail server to pass SPF or DKIM. It guards against mistakes; the secret address is what keeps others out.
  • A limit per hour. Each webhook takes 20 e-mails and calls an hour together unless you change it, so a device in trouble can’t use up your texts.
  • One e-mail, one text to each number, even if the e-mail is delivered twice. E-mails marked as spam or as carrying a virus are dropped.

Limits worth knowing

  • Keep alerts small. An e-mail over 150 KB is returned to its sender instead of becoming a text, so leave out big attachments and pictures.
  • The phone must be on and online. If it isn’t, the text waits in your account and goes out when the phone is back, for up to 3 days. If an alert must never depend on one phone being on and online, an SMS API provider fits that alert better.
  • Plans. Each text counts like any other. The Free plan covers 25 texts a day and 500 a month.

Common questions

Do I have to install anything on the NAS or the UPS?

No. The device only needs to send an e-mail, as it already can.

Can several people get the same alert?

Yes. A webhook has up to 10 numbers, and each gets its own text.

Does SMSTunnel keep my e-mails?

No. It keeps the text that goes out, like any other text you send. Of the e-mail itself it keeps only an identifier, so the same e-mail isn’t texted twice.

See also

More from the blog

Try it with your own phone

Install the Android app, sign in, and your own software can send its first text in a few minutes. The Free plan needs no credit card.