// free agents / email-to-discord

📨 Email to Discord, Telegram or Slack

“Post new emails from my support inbox into a Discord channel or Telegram chat, with filters per inbox.”

Free, no sign-up. MIT licence. Python standard library only, so there's nothing to pip install.

What it does

Watches one or several IMAP inboxes (Gmail, Outlook, Fastmail, any IMAP) and posts each new matching email (sender, subject, 300-character preview, attachment names) to a Discord channel, a Telegram chat, group or channel, and/or Slack. Each inbox can have its own filters and its own destinations. The first run only remembers what's already there, so nothing is flooded. Emails are never marked read.

What you need

5-minute setup

Python

  1. Install Python 3.9+ and unzip the download.
  2. Try it with no accounts: python3 email_to_discord.py --eml-dir sample_emails --dry-run
  3. Copy .env.example to .env and fill it in.
  4. Run: set -a; . ./.env; set +a; python3 email_to_discord.py (Windows steps in the README).

n8n (no code)

  1. Workflows, then Import from file, then email-to-discord.n8n.json.
  2. Follow the yellow “Read me” note (credentials or webhook).
  3. Test workflow, then switch it to Active.

Run it on a schedule

Every 5 minutes with cron:

*/5 * * * * cd /path/to/email-to-discord && set -a && . ./.env && set +a && python3 email_to_discord.py >> run.log 2>&1

On Windows use Task Scheduler. With n8n, the Schedule node does it for you.

Settings

VariableWhat it does
IMAP_HOST / IMAP_USER / IMAP_PASSWORD / IMAP_FOLDEROne inbox (default folder INBOX)
DISCORD_WEBHOOK_URLOptional: your Discord webhook
TELEGRAM_BOT_TOKEN / TELEGRAM_CHAT_IDOptional: Telegram bot token from @BotFather and the chat, group or channel id (or @channelname)
SLACK_WEBHOOK_URLOptional: Slack incoming webhook URL
FROM_CONTAINS / SUBJECT_CONTAINS / EXCLUDEOptional comma-separated filters
INBOXES_FILESeveral inboxes: a JSON file like inboxes.example.json (own filters and destinations each)
MAX_PER_RUN / PREVIEW_CHARSDefaults 20 / 300

What we tested

Honest limits

Related guides

Want one built for your task?

Describe it in one sentence. We build it, test it and email it to you, usually within 24h. Free while we're in beta.

We'll only email you about your agent and TaskToAgent.