How imap.pm Works
A complete guide to setting up real-time email routing to Telegram, Discord, webhooks, or a blackhole sink — with visual walkthroughs of every step.
How It Works
imap.pm connects to your IMAP mailbox, listens for new mail via IMAP IDLE (push), and instantly forwards it to your configured messaging destination. No polling delays, no forwarding rules on your provider, no browser required.
Step 1: Create a Bot
A bot is the delivery agent — the credentials imap.pm uses to send messages. For Telegram, create one via @BotFather. For Discord, create a webhook in channel settings. For custom integrations, any HTTPS endpoint works.
Bots / Webhooks
| Name | Platform | Token | Actions |
|---|---|---|---|
| My Notifications Bot | telegram | 748192...E3Ko | Edit Del |
| Finance Webhook | webhook | https://n8n.e...bok | Edit Del |
Step 2: Create a Destination
A destination pairs a bot with a target — a specific Telegram chat, Discord channel, or webhook route. One bot can deliver to many destinations.
Destinations (2 targets)
| Status | Name | Bot | Target | Actions |
|---|---|---|---|---|
| online | Ops Alerts | My Notifications Bot | -1001234567890 | Edit Test Del |
| online | Finance Channel | Finance Webhook | incoming | Edit Test Del |
Step 3: Add an IMAP Account
Connect your mailbox. Provide the IMAP server string, credentials, a PIN for preview security, and choose a default destination.
Synced Accounts
| State | Mailbox | IMAP Server | Destination | Flags |
|---|---|---|---|---|
| online | alerts@example.com | {mail.example.com:993/imap/ssl} | Ops Alerts online | - |
IMAP Server String Format
| Format | Description |
|---|---|
{mail.example.com:993/imap/ssl} | Standard SSL on port 993 (most providers) |
{mail.example.com:993/imap/ssl/novalidate-cert} | SSL without certificate validation (not recommended) |
{imap.gmail.com:993/imap/ssl} | Gmail (requires App Password) |
{outlook.office365.com:993/imap/ssl} | Microsoft 365 / Outlook |
Step 4: Routing Rules (Optional)
Routing rules let you override or copy mail delivery based on conditions. Rules are evaluated top to bottom — drag rows to reorder.
Routing Rules
Condition Reference
| Field | Matches Against |
|---|---|
| Mailbox | The tracked email address (the IMAP account) |
| Sender | Full From address (e.g. service@example.com) |
| Sender domain | Domain part only (e.g. example.com) |
| Recipient domain | Domain of the envelope To address |
| Recipient address | Full envelope To address |
| Body | Email body text content |
| Destination | The current channel (for chaining rules) |
Effects
| Effect | Behavior |
|---|---|
| Send here instead | Replaces the default destination with the rule’s destination |
| Send as copy | Delivers to both the default destination AND the rule’s destination |
| Do nothing | Suppresses delivery for matching mail (no destination needed) |
Tutorials
Forward “incoming transfer” emails to a webhook
Route bank transfer notifications from service@example.com to an n8n/Zapier webhook when the body contains “incoming transfer”.
Now any email from service@example.com containing “incoming transfer” in the body will be forwarded to your webhook AND your default Telegram destination.
Route OTP codes to a private Telegram chat
Send all emails containing “verification code” or “OTP” to a dedicated private chat so you can quickly copy them on mobile.
Start a conversation with your bot on Telegram. Send /start. The bot replies with your Chat ID (a number like 123456789).
OTP emails now arrive in both your group chat AND your private chat for quick mobile access.
Suppress noisy marketing emails
Stop newsletter spam from @marketing.shopify.com from cluttering your Telegram group.
Emails from marketing.shopify.com are silently dropped. All other mail continues to your default destination.
Mirror all mail to Discord + Telegram simultaneously
Send every incoming email to both a Discord channel (via webhook) and a Telegram group.
When adding your IMAP account, select your Telegram destination as the default. All mail goes there by default.
Since every email address contains @, this rule matches all mail and copies it to Discord. The default Telegram delivery still happens.
Managed Mailboxes & Catch-All
imap.pm offers managed mailboxes under the @imap.pm domain. Instead of connecting your own IMAP server, you get a ready-to-use mailbox that is already synced — just configure your destinations and routing rules.
How managed mailboxes work
- You get an address like
yourname@imap.pm - The mailbox is already connected — no IMAP credentials or server strings needed
- Incoming mail is forwarded to your destinations in real time, just like self-managed accounts
- After successful delivery, managed mailboxes auto-delete processed messages from the source inbox
- All routing rules, preview links, and PIN features work the same way
Pro tip: Catch-all forwarding
Set up a catch-all on your own domain that forwards everything to yourname@imap.pm. Then use routing rules to match the original recipient address and route each forwarded email to the right destination.
For example, if admin@yourdomain.com and billing@yourdomain.com both forward to yourname@imap.pm, you can create routing rules based on Recipient address to send them to different Telegram groups.
What forwarded messages look like
When a catch-all forward delivers to your managed mailbox, imap.pm shows both the managed mailbox and the original recipient:
📨 Telegram message
Route catch-all forwards by original recipient
You have yourname@imap.pm as a catch-all. Route emails originally sent to billing@yourdomain.com to a #finance channel and support@yourdomain.com to a #support channel.
In your domain DNS or email provider, configure a catch-all forward so that all addresses at yourdomain.com forward to yourname@imap.pm.
Create two Telegram destinations: “Finance Team” pointing to your finance group chat, and “Support Team” pointing to your support group chat.
Now billing emails go to #finance, support emails go to #support, and everything else goes to your default destination. The message shows both the imap.pm mailbox and the original recipient so you always know where the email was originally sent.
Encrypted Mail Previews
When “Include Mail Preview Link” is enabled, each forwarded message includes a secure link to view the full HTML email.
Mail Preview (as seen by recipient)
Your order #12847 has shipped
Mailbox: alerts@example.com
From: shipping@store.com
Date: 2 Apr 2026, 14:32 UTC
Hi there, your order #12847 has been shipped via FedEx. Track it at...
Security
- IMAP passwords are encrypted at rest using a server-side secret key
- Email content is forwarded in real time — not stored persistently
- Preview cache is time-limited (configurable TTL) and destroyable via PIN
- HTML previews are rendered in sandboxed iframes with scripts stripped
- Admin sessions use HttpOnly, Secure cookies (24h expiry)
- Bot tokens and webhook URLs are masked in the admin UI