Secure Email Bridge for Discord β Forward POP3 Emails to Discord Webhooks
Ravenclaw is an open-source email-to-Discord bridge that connects your inbox to messaging platforms. Forward emails from any POP3 server to Discord channels via webhooks with zero latency. Features domain filtering, SMTP replies, auto-respond, and production-ready stability.
Keywords: email bridge, discord webhook, pop3 email, smtp, email notification, email forwarder, discord bot, python automation, self-hosted, email alerts, discord notifications
https://github.com/ibrahimq21/openclaw-skill-ravenclaw.git
π§ Email (POP3/SMTP) β π¬ Ravenclaw β π¬ Discord (Webhook)
Receive email notifications directly in your Discord server. Perfect for:
- π¬ Support tickets β Get notified of new emails instantly
- π Alerts β Server notifications, monitoring alerts
- π Automation β Trigger workflows from email content
- π’ Teams β Share emails across departments without sharing accounts
| Feature | Ravenclaw | Zapier | IFTTT | Custom Solutions |
|---|---|---|---|---|
| Cost | Free (self-hosted) | $50+/mo | Free tier limited | Dev time |
| Privacy | β Your data stays local | β Cloud | β Cloud | β Controlled |
| Customization | Full Python access | Limited | Limited | Complete |
| Setup Time | 5 minutes | 10 minutes | 10 minutes | Hours/Days |
| Discord Native | β Webhook built-in | Integration needed | Integration needed | Custom dev |
- π§ Email to Discord β Forward emails to channels automatically
- π Server Alerts β Get notified of system issues in real-time
- π¬ Support Tickets β Route support emails to Discord channels
- π€ Automation β Trigger Discord actions from email content
- π Monitoring β Connect email-based alerts to team chat
- π₯ POP3 Email Fetching β Securely fetch emails from any POP3 server
- π Domain Filtering β Whitelist allowed domains for security
- π¬ Discord Integration β Forward emails to Discord channels via webhooks
- π€ SMTP Replies β Send email replies directly from Discord
- β° Scheduled Checks β Configurable polling interval (default: 30 min)
- π JSON Storage β All emails stored in readable JSON format
- π€ Auto-Reply β Automatic acknowledgment responses
- π‘οΈ Stability β Memory leak prevention, log rotation, graceful shutdown
- β° Scheduled Emails β Schedule emails to be sent at specific times via JSON queue
- π Scheduled Email Templates β
example-schedule.jsonprovides templates for scheduling emails
# 1. Clone and enter directory
git clone https://github.com/ibrahimq21/ravenclaw.git
cd ravenclaw
# 2. Install dependencies
pip install -r requirements.txt
# 3. Configure environment
cp .env.example .env
# Edit .env with your email and Discord webhook
# 4. Run the bridge
python ravenclaw.py
# 5. Test with curl
curl http://localhost:5002/healthThat's it! Emails will now forward to your Discord channel.
Create a .env file:
# Email Settings
EMAIL_HOST=mail.yourdomain.com
EMAIL_POP_PORT=995
EMAIL_SMTP_PORT=587
EMAIL_USERNAME=your@email.com
EMAIL_PASSWORD=yourpassword
# Security
DOMAIN_FILTER=example.com,allowed-domain.com
# Discord Webhook
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/...
# Bridge Settings
BRIDGE_HOST=0.0.0.0
BRIDGE_PORT=5002
BRIDGE_POLL_INTERVAL=30Schedule emails to be sent at specific times using the API or JSON queue.
curl -X POST http://localhost:5002/schedule \
-H "Content-Type: application/json" \
-d '{
"to": "recipient@domain.com",
"subject": "Leave Request",
"body": "Dear Manager,\n\nI would like to request leave...",
"target_time": "2026-02-20T09:00:00",
"priority": "high"
}'Copy example-schedule.json to ravenclaw_scheduled.json and add your emails:
cp example-schedule.json ravenclaw_scheduled.json
# Edit ravenclaw_scheduled.json with your email content{
"version": "1.0",
"emails": [
{
"id": "unique_id",
"to": "recipient@domain.com",
"subject": "Email subject",
"body": "Email body content",
"target_time": "2026-12-31T09:00:00",
"created_at": "auto-generated",
"status": "pending|sent|failed|cancelled",
"attempts": 0,
"priority": "normal|high|low"
}
]
}Note: ravenclaw_scheduled.json stores your actual scheduled emails. Use example-schedule.json as a template.
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Bridge status |
/health |
GET | Health check with stats |
/inbox |
GET | Get all emails |
/inbox/<id> |
GET | Get specific email |
/unread |
GET | Get unread emails |
/send |
POST | Send email reply |
/check |
POST | Trigger manual email check |
/stats |
GET | Processing statistics |
/mark-read/<id> |
POST | Mark email as read |
/schedule |
POST | Schedule an email to be sent later |
/schedule/list |
GET | List all scheduled emails |
/schedule/cancel/<id> |
POST | Cancel a scheduled email |
/check-scheduled |
POST | Trigger manual scheduled email check |
Ravenclaw includes enterprise-grade stability features:
- Inbox Limits β Maximum 1000 emails stored (prevents JSON bloat)
- Log Rotation β 1MB log files with 5 backups (prevents disk full)
- State Trimming β Sync state limited to 500 msg IDs
- Graceful Shutdown β SIGINT/SIGTERM handlers for clean exit
- In-Memory Caching β State cached in sync watcher (reduces I/O)
Phase 1 β Current
- β Discord Webhooks
- β Discord Bot Integration
- β JSON File Watcher
- β Stability & Memory Management
Phase 2 β Community Contributions Welcome
- π Slack β Channel and user notifications via Bot Token
- π Telegram β Bot API integration for private and group chats
- π WhatsApp β Twilio or Baileys integration
- π Matrix β Synapse bot support
- π Email Rules β Filter, label, and forward based on content
Phase 3 β Advanced
- π Multiple Accounts β Support for multiple email/Discord pairs
- π Plugins β Plugin architecture for custom integrations
- π Web UI β Dashboard for managing connections
We welcome contributions! Here's how you can help:
- Create a new file:
ravenclaw_channels/slack.py - Implement the channel interface:
def send_message(sender, subject, body, msg_id):
"""Send email content to Slack"""
# Your implementation
pass- Add to
ravenclaw.pychannel registry:
from ravenclaw_channels import slack, telegram
CHANNELS = {
'discord': discord.send_message,
'slack': slack.send_message,
'telegram': telegram.send_message,
}- Submit a PR!
- Bug fixes and improvements
- Documentation enhancements
- Security audits
- Test coverage
Email Server (POP3)
β
Ravenclaw Bridge
β
ββββββββ΄βββββββ
β Channels β β Extensible plugin system
ββββββββ¬βββββββ
β
Discord / Slack / Telegram / WhatsApp / ...
MIT License β Feel free to use, modify, and distribute.
- π Report issues on GitHub
- π¬ Join our Discord community
- π§ Email: maintainers@project.email
Maintainers:
- Ibrahim Qureshi β ibrahimq21@gmail.com
Built for secure, flexible email bridging. Make it yours.