Device alerts by e-mail: your NAS, router and camera on your phone

Many devices report problems only by e-mail. Here is how to get those alerts on your phone through a mail trap, without handing out your real mailbox.

By Umut TufanogluUpdated October 24, 20264 min read

Your NAS reports a dying disk, your router a new device on the network, your camera some movement, your heating a drop in pressure. Many of these devices can send alerts in only one way: by e-mail. For that they want a mail server with a username and password. The obvious answer is your own mailbox, and that is exactly where the trouble starts.

Why not just use your own mailbox?

  • Your password lives in the device. Even an app password opens your whole mailbox. If the device is hacked, sold or thrown away, the access goes with it.
  • Alerts get buried. Between newsletters and invoices you miss the one mail that matters.
  • No overview. Which device reported what, and when? In a normal inbox you have to piece that together yourself.

A separate mailbox just for devices works better, with its own login that you can change at any time.

A mail trap as a device mailbox

With a TossPost account you create up to three mail traps under Settings → Mail traps. Each trap has its own SMTP login and a permanent inbox. Everything a device sends through that login lands in this inbox, whatever address it was sent to. Nothing is passed on by SMTP. Mail traps are meant for test systems, and they work just the same for devices.

Step by step

  1. Create a trap. Give it a name, for example "NAS basement". TossPost shows you the password exactly once. Copy it right away.
  2. Enter the mail server in the device. Depending on the maker, the settings are called "SMTP", "outgoing mail server" or "e-mail notification":
Field Value
Server the server shown on the "Mail traps" page
Port 587
Encryption STARTTLS (sometimes "TLS", not "SSL/TLS" on port 465)
Authentication on, with the user trap_… and the copied password
Sender, recipient anything; the mail ends up in the trap either way
  1. Send a test mail. Almost every device has a button for it. The mail shows up in the trap's inbox within seconds. You open it with "Open inbox" next to the trap.

Ideally use one trap per device or per location. Then you see at once who is calling, and when you give a device away, "New password" creates a new login. The old password stops working immediately.

Turning mail into notifications

The trap's inbox is an ordinary inbox of your account. That gives you several ways to pass the alerts on:

  • Push to your phone or browser: open the inbox and tap "Notify me". Every new mail arrives as a notification with sender and subject, even when the page is closed.
  • Webhook: with a webhook under Settings → API, TossPost sends a signed message to a server of your choice for every new mail, for all inboxes or only this one. That way home automation or a chat bot can react to the alert. The content of the mail is only included if you ask for it.
  • Forwarding: under "My inboxes" → "Forward", copies go to a confirmed real address, only mails with a code or link if you like. An account forwards at most 100 mails a day.
  • Feed: a permanent inbox can have a secret feed address for your feed reader.
  • API: scripts read the inbox through the REST API and can wait for the next mail with messages/wait.

Limits you should know

  • STARTTLS and a login are required. Devices that only send unencrypted or only on port 465 won't get through.
  • 60 mails per minute and trap. Anything beyond that is refused by the server. A device that sends a mail on every movement should be throttled.
  • At most 10 MB per mail. Large camera pictures or videos don't belong in the attachment.
  • The inbox is not an archive. It keeps the 50 newest mails, and we delete mail in permanent inboxes after 30 days.
  • Push is not an alarm system. Notifications travel through the browsers' push services and can be delayed. For smoke detectors, medical devices or anything where lives are at stake, you need a service with guaranteed delivery.

The same trap also works for test systems that send e-mail. How to check e-mails in automated tests is covered in How to test e-mails in automated tests.

Written by Umut Tufanoglu, who builds and runs TossPost. About TossPost

Try it yourself