This is a submission for the Postmark Challenge: Inbox Innovators.
Ever wished your incoming support, careers, or operations emails could instantly land in your teamβs Discord channels so you can notify the right people, ask for input, and triage issues collaboratively?
Email workflows are often rigid and slow. InboxNinja transforms that experience by giving teams a real-time, customizable email relay bot that plugs directly into their Discord workspace.
What I Built
InboxNinja is a real-time, self-hosted email relay bot designed for operational teams. It receives emails via Postmark, processes them through a webhook, summarizes the content, and neatly delivers it into specific Discord channels. Messages arrive organized in threads, with attachments and action buttons for instant response.
It turns inboxes from static, disconnected workflows into real-time, actionable conversations inside Discord.
Demo
Code Repository
vivekthedev
/
inboxninja
a real-time, self-hosted email relay bot
π¨ InboxNinja
A powerful, real-time email-to-Discord relay system for operational teams.
This application uses Postmark's Inbound Email Webhooks to receive emails for different departments (Careers, Support, Legal, Operations, Partnerships), summarizes the content and forwards it to the appropriate Discord channel.
Built for productivity, team alignment, and instant issue management. π
π― Features
β
Real-time email forwarding via Postmark Webhook
β
Automated summarization using Gemini / LLM
β
Auto-routing to relevant Discord channels based on the email address
β
Supports attachments and file relaying
β
Interactive buttons for support teams to respond quickly
β
Modular and clean code with Quart + Discord.py
βοΈ Tech Stack
- Postmark Inbound Webhooks
- Discord.py
- Quart (Async Flask Alternative)
- Google Gemini / Summarizer
- Python Asyncio
- dotenv for secure config
ποΈ Project Architecture
/project-root
βββ app.py # Main application β runs both Discord bot & Quart server
βββ bot.py # Discord bot button views
βββ gemini.py #
β¦How I Built It
- Postmark Inbound Webhooks for core email parsing and forwarding
- Postmark API to retrieve complete message data via Message ID
- Discord.py to build the Discord bot, send messages, handle buttons, and manage threads
- Quart as the asynchronous web server for webhook handling
How it Works
The app runs two asynchronous services. A Quart web server handles webhooks, and a Discord bot manages messages and actions.
Workflow Overview
- A new email arrives at Postmark.
- Postmark's inbound webhook forwards the email payload to the /webhook endpoint.
- The server extracts key details like sender info, subject, body text, and attachments.
- It determines the appropriate Discord channel based on the email address.
- The message is summarized using Gemini AI. Attachments are decoded and a clean message template is prepared.
- The bot posts this into the right channel, starting a dedicated thread per sender.
- Action buttons like βShow Full Emailβ and βMark as Resolvedβ are attached.
Challenges
Managing both the asynchronous Quart server and Discord bot within a single process required careful event loop handling. Async conflicts, especially with asyncio.run(), demanded thoughtful debugging and examples from public repositories.
Handling attachments was another tricky area. Postmark delivers them as base64 strings, which needed decoding and repackaging as Discord File objects while preserving file metadata.
Discord.pyβs documentation around custom button views was limited. After exploring community examples and third-party resources, I was able to implement this functionality effectively.
Conclusion
I am proud of how this project came together. It is functional, cleanly built, and addresses a genuine workflow problem for modern operational teams. In future, I am planning to build a lightweight priority detection system for support emails and using Postmark's Transactional Email service for reply
Top comments (1)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.