Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Mailor — Discord Email Client Bot

Badges

Build Version License

Python Discord.py Node.js Playwright

Repo Size Stars Forks Issues


Overview

Mailor is a Discord-based email client that allows users to manage and interact with their email accounts directly inside Discord.

Instead of opening Gmail or Outlook, users can read emails, search messages, and render HTML emails as images using simple slash commands.

The system is designed to be fast, private, and fully interactive using Discord UI components.


Core Idea

Mailor connects to email providers using IMAP and transforms Discord into a lightweight email dashboard.

Each user can securely link their email accounts and:

  • Access inbox messages
  • Navigate emails with buttons
  • Read content inside embeds
  • Render HTML emails visually
  • Search messages instantly

All interactions are private and tied to the user.


Features

Account System

  • Add email accounts using IMAP
  • Store multiple accounts per user
  • Remove accounts anytime
  • Browse accounts interactively

Inbox Navigation

  • Fetch latest emails
  • Limit number of results
  • Filter unread messages
  • Navigate with buttons:
    • First
    • Previous
    • Next
    • Last

Email Reading

  • View subject, sender, and date
  • Read plain-text content
  • Automatic pagination for long emails

HTML Rendering

  • Convert HTML emails into images
  • Full-page rendering using Playwright
  • Display result directly in Discord

Search

  • Search emails by subject keyword
  • Interactive result navigation

Folder Support

  • List all available folders
  • Read emails from custom folders

Statistics

  • Total emails
  • Unread count
  • Read count

Security

  • Per-user data isolation
  • Ephemeral responses only
  • No shared data between users

Tech Stack

Backend:

  • Python 3
  • discord.py
  • asyncio

Email:

  • imaplib
  • email module (MIME parsing)

Rendering:

  • Node.js
  • Playwright (Chromium)

Storage:

  • JSON database (accounts.json)

How It Works

  1. User adds an email account using IMAP credentials
  2. Bot connects securely to the email server
  3. Emails are fetched and parsed
  4. Data is displayed using Discord embeds
  5. Navigation is handled with buttons
  6. HTML emails can be rendered into images using Playwright

Installation

Clone repository:

git clone https://github.com/gl1tch496/mailor.git cd mailor

Install Python dependencies:

pip install discord.py

Install rendering engine:

npm install playwright npx playwright install chromium

Create environment file:

.env

Add:

DISCORD_TOKEN=your_bot_token


Run

python bot.py


Commands

Account:

/add imap_server email_account app_password
/accounts
/remove email_account

Inbox:

/inbox email_account [limit] [unread_only] [folder]
/read email_account position [folder]
/render email_account position [folder]

Utilities:

/folders email_account
/search email_account keyword [folder]
/stats email_account
/help


Usage Example

  1. Add your email: /add imap.gmail.com example@gmail.com app_password

  2. Open inbox: /inbox example@gmail.com

  3. Navigate messages using buttons

  4. Read email: /read example@gmail.com 1

  5. Render HTML email: /render example@gmail.com 1


UI System

  • Interactive buttons for navigation
  • Dynamic embed updates
  • User-restricted views
  • Auto timeout after 5 minutes

Rendering Pipeline

HTML Email
→ Wrapped Template
→ Playwright Chromium
→ Screenshot
→ PNG sent to Discord


Security Notes

  • Credentials stored locally
  • No external APIs used
  • Recommend app passwords instead of real passwords
  • Users can only access their own data

Limitations

  • Requires IMAP-enabled accounts
  • Playwright required for rendering
  • Local JSON storage only
  • No encryption yet

Roadmap

  • Database integration
  • OAuth login
  • Attachment support
  • Real-time notifications
  • Web dashboard

License

MIT License


Author

Mailor is designed for fast and private email management directly inside Discord

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages