Professional Desktop Email Management System with Advanced Attachment Organization
A powerful, modern email management application built with PyQt5 that provides comprehensive email organization, advanced tagging, and intelligent attachment management for professionals and organizations.
- 🔐 Secure Multi-User Dashboard - Complete user authentication with email verification
- 📬 Multi-Account Email Management - Support for multiple IMAP email accounts
- 🏷️ Smart Auto-Tagging System - Custom rules with automatic attachment saving
- 📎 Advanced Attachment Search - Search across all attachment metadata
- ⚡ Bulk Operations - Mass email management and organization
- 🎨 Modern UI - Outlook-inspired professional interface
- 📊 Analytics Dashboard - Comprehensive email statistics and insights
- Python 3.7 or higher
- MySQL Server
- Git
-
Clone the repository
git clone https://github.com/haiderali-dev/Email-Attachments-Manager-SORT-E.git cd email-attachments-manager -
Install dependencies
pip install -r requirements.txt
-
Configure Environment Variables
Create your environment file from the template:
# Copy the template cp env_template.txt .env # Edit with your credentials nano .env # or use your preferred editor
-
Set up Database Credentials
Edit your
.envfile with your MySQL database credentials:# Database Configuration DB_HOST=localhost DB_USER=your-username DB_PASSWORD=your-password DB_PORT=3306 DB_NAME=email_manager
-
Configure Email Verification
Set up SMTP credentials for user verification emails:
# Email Verification Configuration SMTP_SERVER=smtp.gmail.com SMTP_PORT=465 SMTP_USERNAME=[email protected] SMTP_PASSWORD=your-app-password
-
Run the application
python main.py
| Variable | Description | Default |
|---|---|---|
DB_HOST |
MySQL server host | localhost |
DB_USER |
MySQL username | root |
DB_PASSWORD |
MySQL password | (empty) |
DB_PORT |
MySQL port | 3306 |
DB_NAME |
Database name | email_manager |
SMTP_SERVER |
SMTP server for verification | smtp.gmail.com |
SMTP_PORT |
SMTP port | 465 |
SMTP_USERNAME |
SMTP username | (required) |
SMTP_PASSWORD |
SMTP password/app password | (required) |
- Enable 2-Factor Authentication on your Gmail account
- Generate an App Password:
- Go to Google Account settings
- Security → 2-Step Verification → App passwords
- Generate password for "Mail"
- Use the App Password in your
.envfile (not your regular password)
# Application Settings
DEFAULT_IMAP_HOST=mail2.multinet.com.pk
SESSION_DAYS=90
REAL_TIME_MONITORING=true
MONITORING_INTERVAL=30
PROGRESSIVE_BATCH_SIZE=200
PROGRESSIVE_COMMIT_INTERVAL=100The application will automatically create the required database and tables on first run. Ensure your MySQL server is running and accessible with the credentials specified in your .env file.
For user registration verification emails, configure your SMTP settings in your .env file. The application supports:
- Gmail: Use App Passwords (recommended)
- Outlook/Hotmail: Use regular passwords
- Custom SMTP: Configure your own SMTP server
The application uses a combination of:
- Environment Variables (
.envfile) - For sensitive credentials and core settings - Config File (
config.json) - For user preferences and UI settings
- Environment Variables: All sensitive data stored in
.envfile (not committed to git) - Password Encryption: Email passwords encrypted with Fernet encryption
- Auto-Generated Keys:
secret.keyfile auto-generated for encryption - User Isolation: Complete data separation between dashboard users
- Register Account: Create a new user account with email verification
- Add Email Accounts: Configure your IMAP email accounts
- Set Up Tags: Create custom tags for email organization
- Configure Rules: Set up auto-tagging rules with attachment saving
- Email Management: View, search, and organize emails across multiple accounts
- Attachment Handling: Search, view, and download attachments with custom paths
- Bulk Operations: Perform mass operations on emails and attachments
- Analytics: Monitor email statistics and usage patterns
Built with clean architecture principles:
- Models: Database entities and data structures
- Views: PyQt5 UI components organized by feature
- Controllers: Business logic and user interaction handling
- Services: External system interactions (IMAP, database, filesystem)
- Workers: Background processing for async operations
- Password Encryption: bcrypt hashing with salt
- Email Password Encryption: Fernet symmetric encryption
- Account Lockout: 5-attempt limit with timeout
- Session Management: Configurable session duration
- User Isolation: Complete data separation between users
The application uses a unified MySQL database with the following core tables:
dashboard_users- User accounts and authenticationaccounts- Email account configurationsemails- Email storage with metadatatags- User-defined tagsauto_tag_rules- Custom tagging rulesattachments- Attachment metadata and storage
- Smart Duplicate Prevention: Avoids re-downloading existing emails/attachments
- Real-time Monitoring: Live email synchronization
- Progressive Loading: Optimized performance for large email volumes
- Cross-Platform: Windows, macOS, and Linux support
- High DPI Support: 4K and high-resolution display compatibility
email-attachments-manager/
├── main.py # Application entry point
├── requirements.txt # Python dependencies
├── config/ # Configuration files
├── models/ # Database models
├── views/ # UI components
├── controllers/ # Business logic
├── services/ # External services
├── workers/ # Background processing
├── utils/ # Utilities and helpers
└── docs/ # Documentation
This project is licensed under the Copyright (c) 2025 Haider Ali. All Rights Reserved. - see the LICENSE file for details.
- Environment File: Never commit
.envfile to version control - Template File: Use
env_template.txtas a reference for required variables - Email Passwords: All email passwords are encrypted before storage
- App Passwords: Use App Passwords for Gmail SMTP authentication
- Encryption Key: The
secret.keyfile is auto-generated and should never be shared - Backup: Regularly backup your database and configuration files
- Security: Keep your
.envfile secure and never share it publicly
- SETUP.md - Detailed setup guide with step-by-step instructions
- LICENSE - Project license and copyright information
For support, feature requests, or bug reports, please open an issue on GitHub.
Built with ❤️ using PyQt5, Python, and MySQL










