Skip to content

Signing up for Discord? Some of our domains are accepted there. See which ones on the Domains page.

CyberTemp
All posts

How to Pipe CyberTemp Inbox Mail Into Slack

CyberTemp5 min read

Need a disposable inbox right now?

Spin up a temporary email address in seconds — no signup, no spam, no trace.

Get a free inbox

If a verification email, OTP, or signup confirmation lands in a disposable inbox and nobody's watching that inbox, it's effectively lost. That's fine for a one-off browser test. It's not fine when a CI job, a bot, or a teammate needs to see that message the moment it arrives. This is how to wire a CyberTemp inbox into Slack with a small polling script, so new mail shows up as a channel message instead of sitting in an API response nobody checked.

Why a polling script instead of a webhook

CyberTemp's API is pull-based. You call GET /getMail?email=... and you get back whatever's in that inbox right now, most recent first. There's no push endpoint and no event stream — if you want near-real-time delivery, you build a loop that asks the question repeatedly and reacts the moment the answer changes.

That's a feature, not a workaround. A polling loop is three lines of logic you can read in ten seconds, runs anywhere you can run a script, and fails in predictable ways. A webhook consumer needs a public endpoint, a signature check, and a retry story for when your own server is down. For a single inbox feeding a Slack channel, polling is less to maintain.

What you need

  • A CyberTemp API key (X-API-Key: tk_...) — generate one from your account after signing up at cybertemp.xyz

  • An inbox address, either one you generate on the site or one you create implicitly by calling GET /getMail against an address that doesn't exist yet

  • A Slack incoming webhook URL for the channel you want messages in

  • Python with httpx or requests installed

The polling script

This checks the inbox every few seconds, tracks which message IDs it's already posted, and sends new ones to Slack as they show up:

import time
import httpx

CYBERTEMP_KEY = "tk_..." SLACK_WEBHOOK = "https://hooks.slack.com/services/..." INBOX = "[email protected]" POLL_SECONDS = 10

HEADERS = {"X-API-Key": CYBERTEMP_KEY} seen_ids = set()

def fetch_mail(): resp = httpx.get( "https://api.cybertemp.xyz/getMail", params={"email": INBOX}, headers=HEADERS, timeout=10, ) resp.raise_for_status() return resp.json()

def post_to_slack(message): text = f"New mail to {INBOX}\nFrom: {message['from']}\nSubject: {message['subject']}" httpx.post(SLACK_WEBHOOK, json={"text": text}, timeout=10)

while True: for msg in fetch_mail(): if msg["id"] not in seen_ids: seen_ids.add(msg["id"]) post_to_slack(msg) time.sleep(POLL_SECONDS)

Run that in a terminal, in a tiny systemd unit, or inside a CI job that needs to watch for a signup confirmation mid-pipeline. The seen_ids set is what keeps it from reposting the same message every ten seconds — swap it for a small SQLite table or a Redis set if the script needs to survive restarts.

Extracting OTP codes automatically

If the thing landing in the inbox is a one-time code rather than a general notification, post the code directly instead of the raw subject line. A short regex on the message body handles most providers:

import re

def extract_otp(body): match = re.search(r"\b\d{4,8}\b", body) return match.group(0) if match else None

def post_to_slack(message): otp = extract_otp(message.get("body", "")) if otp: text = f"OTP for {INBOX}: {otp}" else: text = f"New mail to {INBOX}\nSubject: {message['subject']}" httpx.post(SLACK_WEBHOOK, json={"text": text}, timeout=10)

This is the same extraction logic the CyberTemp Go SDK's WaitForOTP helper does server-side (available on paid tiers) — if a team is already on the Go SDK for a test suite, it's worth using that helper directly instead of hand-rolling the regex, since it also handles the polling loop and timeout for you.

Handling rate limits

A ten-second poll interval against a single inbox stays well under any plan's rate limit, but if the script watches several inboxes at once, space the requests out rather than firing them all in the same second. CyberTemp returns a 429 with a retryAfter field when a key is polling too fast — catch that, sleep for the stated number of seconds, and resume. Treat it as a signal to slow down, not an error to retry immediately.

resp = httpx.get(url, params=params, headers=HEADERS)
if resp.status_code == 429:
    wait = resp.json().get("retryAfter", 30)
    time.sleep(wait)
else:
    resp.raise_for_status()

When one script becomes five

A single inbox watcher like the one above runs comfortably on CyberTemp's FREE tier. The moment this turns into a pattern — one inbox per deploy environment, one per CI run, one per teammate who wants their own alert channel — concurrent inbox limits and request quotas start to matter. ECO and CORE raise both ceilings, and ELITE is built for teams running this kind of polling fleet continuously rather than one script at a time.

Bottom line

A ten-line polling loop is enough to turn a disposable inbox into a Slack notification stream. Start with one inbox and one channel, confirm the message shapes match what the regex or the subject-line fallback expects, then scale the number of watched inboxes to match whatever you're actually testing or monitoring.

If this is for recurring automation rather than a one-off script, check the plan tiers before running more than a couple of inboxes at once — it's a quick way to confirm the quota fits before a job starts failing on a 429 at 2am.

Share
    How to Pipe CyberTemp Inbox Mail Into Slack | CyberTemp Blog