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 Mailbox
imap.pm (IDLE push)
Routing Engine
Telegram / Discord / Webhook

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

Platform
telegram
Display Name
My Notifications Bot
Token / URL
7481923456:AAH_kP9xMnRt2vLqWzJ-d8fYcBu0sNiE3Ko
Save Bot
New Bot
NamePlatformTokenActions
My Notifications Bottelegram748192...E3KoEdit Del
Finance Webhookwebhookhttps://n8n.e...bokEdit Del
Each bot can serve multiple destinations. You only need one Telegram bot token for all your Telegram chats.

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)

Platform
telegram
Bot
My Notifications Bot
Target
-1001234567890
Name
Ops Alerts
Send test notification on save
Save Destination
New Destination
StatusNameBotTargetActions
onlineOps AlertsMy Notifications Bot-1001234567890Edit Test Del
onlineFinance ChannelFinance WebhookincomingEdit Test Del
Click “Test” to send a test message and verify the destination is reachable. The status dot turns green on success.

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

Destination
Ops Alerts [My Notifications Bot]
IMAP Server
{mail.example.com:993/imap/ssl}
IMAP User
alerts@example.com
IMAP Password
••••••••••••
PIN
847291
Include Mail Preview Link
Enabled
Verify IMAP Before Save
Yes
Save Account
New Account
StateMailboxIMAP ServerDestinationFlags
onlinealerts@example.com{mail.example.com:993/imap/ssl}Ops Alerts online-
The PIN is auto-generated. Use it to destroy mail previews. “Verify IMAP before save” tests the connection before committing.

IMAP Server String Format

FormatDescription
{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

Sender domain
Equals
amazon.com
end
Destination
Finance Channel [Finance Webhook]
Effect
Send here as copy
Return and stop parsing other rules
Save Routing Rule
Reset
This rule copies all Amazon emails to the Finance Channel while still delivering to the default destination.

Condition Reference

FieldMatches Against
MailboxThe tracked email address (the IMAP account)
SenderFull From address (e.g. service@example.com)
Sender domainDomain part only (e.g. example.com)
Recipient domainDomain of the envelope To address
Recipient addressFull envelope To address
BodyEmail body text content
DestinationThe current channel (for chaining rules)

Effects

EffectBehavior
Send here insteadReplaces the default destination with the rule’s destination
Send as copyDelivers to both the default destination AND the rule’s destination
Do nothingSuppresses 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”.

1Create a webhook bot
Platform
webhook
Display Name
n8n Finance Hook
Token / URL
https://n8n.yourserver.com/webhook/bank-transfers
Save Bot
2Create a destination for the webhook
Platform
webhook
Bot
n8n Finance Hook
Target
Route key (optional)
Name
Bank Transfer Hook
Save Destination
3Create a routing rule with two conditions
Sender
Equals
service@example.com
and
Body
Contains
incoming transfer
end
Destination
Bank Transfer Hook [n8n Finance Hook]
Effect
Send here as copy
Return and stop parsing other rules
Save Routing Rule

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.

1Get your private chat ID

Start a conversation with your bot on Telegram. Send /start. The bot replies with your Chat ID (a number like 123456789).

2Create a “My OTPs” destination
Platform
telegram
Bot
My Notifications Bot
Target
123456789
Name
My OTPs
Save Destination
3Create a routing rule matching OTP keywords
Body
Contains
verification code
or
Body
Contains
OTP
end
Destination
My OTPs [My Notifications Bot]
Effect
Send here as copy
Save Routing Rule

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.

1Create a “Do nothing” routing rule
Sender domain
Equals
marketing.shopify.com
end
Destination
(no destination)
Effect
Do nothing
Return and stop parsing other rules
Save Routing Rule

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.

1Set Telegram as the default destination

When adding your IMAP account, select your Telegram destination as the default. All mail goes there by default.

2Create a catch-all “copy to Discord” rule
Mailbox
Contains
@
end
Destination
Team Discord [Discord Webhook]
Effect
Send here as copy
Save Routing Rule

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

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

📧 New email to admin@imap.pm
➤ forwarded to example@example.org
From: noreply@admin.example.com
Subject: Your monthly invoice is ready
Date: Wed, 2 Apr 2026 14:32:01 GMT
Hi, your invoice for March 2026 is attached. Please log in to your dashboard to view the details...
View Preview

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.

1Set up your catch-all

In your domain DNS or email provider, configure a catch-all forward so that all addresses at yourdomain.com forward to yourname@imap.pm.

2Create destinations for each team channel

Create two Telegram destinations: “Finance Team” pointing to your finance group chat, and “Support Team” pointing to your support group chat.

3Route billing@ to #finance
Recipient address
Contains
billing@yourdomain.com
end
Destination
Finance Team [My Bot]
Effect
Send here instead
Return and stop parsing other rules
Save Routing Rule
4Route support@ to #support
Recipient address
Contains
support@yourdomain.com
end
Destination
Support Team [My Bot]
Effect
Send here instead
Return and stop parsing other rules
Save Routing Rule

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

••••••
Destroy Preview

Hi there, your order #12847 has been shipped via FedEx. Track it at...

Preview links are encrypted tokens. Enter your PIN to permanently destroy the preview. Rate limiting: 5 failed PIN attempts per 15 min, then 30 min block.

Security