ab9eb02564dde18886e47fae25c0f9f97e43e4e7
Email Organizer
A self-hosted AI-powered email organization system that automates folder sorting, prioritization, and rule recommendations through natural language configuration.
Core Value Proposition
- Natural Language Rules: Define email organization logic in plain English instead of writing sieve/filter rules
- Smart Separation: Automatically categorize marketing emails, receipts, and transactional messages
- Adaptive Intelligence: Learns your preferences to star important emails and suggest new organizational patterns
Technical Overview
Stack:
- Backend: Flask (Python 3.10+)
- Frontend: HTMX + AlpineJS + DaisyUI (Tailwind CSS)
- Database: PostgreSQL
- AI: OpenAI-compatible API endpoints
Key Components:
- Rule Engine: Converts natural language rules → executable classification logic
- Email Processor: Polls IMAP server, applies AI classifications, moves messages
- Recommendation System: Analyzes usage patterns to suggest new folders/rules
Getting Started
Prerequisites
- Python 3.10+
- PostgreSQL 14+
- IMAP server access
Setup
# Install dependencies
pip install -r requirements.txt
# Set up development environment (PostgreSQL and IMAP server)
flask setup-dev
# Configure environment
cp .env.example .env
# (Edit .env with your DB/IMAP credentials)
# Initialize database
flask db upgrade
# Run development server
flask run
Roadmap
Milestone 1: Prototype (Current Focus)
- Core infrastructure setup
- Basic UI for rule configuration
- Mock email processing pipeline
- Database schema implementation
Future Milestones
- MVP - enter your imap server. You list out folders and rules, and once a day emails in the "Pending" folder will be reorganized.
- "Import" your list of folders from your imap server
- Polling every 5 minutes, working off recent emails since last poll
- Label support for services like gmail
- Generate config to automate integration into imap servers like dovecot or gmail or proton
- Supporting auth / multi user. Admin controls the list of users, users control their folders.
- Making a paid, hosted version
- Auth via google / facebook / etc.
- Automatically star based off of your habits
Data Model
Users
| Column | Type | Description |
|---|---|---|
| id | UUID | Primary key |
| VARCHAR | Unique identifier | |
| password_hash | BYTEA | Argon2-hashed |
| imap_config | JSONB | Encrypted server settings |
Folders
| Column | Type | Description |
|---|---|---|
| id | UUID | Primary key |
| user_id | UUID | Foreign key |
| name | VARCHAR | Display name |
| rule_text | TEXT | Natural language rule |
| priority | INT | Processing order |
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Note
: All new features require corresponding unit tests and documentation updates.
Description
Languages
Python
80.9%
HTML
18.2%
JavaScript
0.6%
Mako
0.3%