MAWS Auto Printer System
Details
An automated email printing system designed for Windows that monitors Gmail inboxes and automatically prints incoming unread messages to a selected printer. The application features a modern dark-themed GUI inspired by VS Code, with support for test mode (HTML file generation) to reduce paper waste during development and testing.
Status: ✅ Completed and deployed
Repository: https://github.com/Maws7140/mawsprinter
Platform: Windows-only (due to pywin32 dependency)
Language: Python 100%
Core Features
- Automated Email Monitoring: Continuously monitors Gmail IMAP inbox for unread messages
- Automatic Printing: Prints email body content to configured Windows printer
- Test Mode: Simulates printing by saving emails as HTML files (no paper waste)
- Dark-Themed GUI: Professional VS Code-inspired interface with Tkinter/ttk
- Configuration Persistence: JSON-based storage of credentials and settings
- Real-time Logging: Color-coded status messages with export capability
- Manual Test Printing: Send test pages on-demand
Goals & Milestones
Technical Roadmap
Technology Stack
Core Language
- Python 3.x
GUI Framework
- Tkinter (standard library)
- ttk.Style for custom theming
- scrolledtext for log display
Email Integration
imaplib- IMAP4_SSL connectionemailmodule - Message parsing and header decoding- Date-based filtering for unread messages
Windows Printing
win32print- Printer enumerationwin32api- ShellExecute for print spoolingpywin32package (external dependency)
Image Processing
pillow(PIL) - Image handling for logo/assets
Utilities
threading- Background email monitoringjson- Configuration persistencetempfile- Temporary HTML file generation for printingdatetime- Timestamp handling
Architecture
Class Structure
PrinterApp
├── __init__() - UI setup, config loading, printer detection
├── build_ui() - Constructs dark-themed interface
├── load_config() / save_config() - JSON persistence
├── start_monitoring() / stop_monitoring() - Thread control
├── process_emails() - Main IMAP monitoring loop
├── print_text_file() - Handles printing/HTML generation
├── send_test_page() - Manual test functionality
└── safe_decode() - Character encoding fallback
Configuration Format (JSON)
{
"imap_server": "imap.gmail.com",
"email": "user@gmail.com",
"password": "app_password",
"printer": "Selected Printer Name"
}
Email Processing Flow
- Connect to IMAP server via SSL
- Search for UNSEEN messages since current date
- Fetch and parse email content
- Extract subject and plain-text body
- Generate HTML-formatted document
- Print to Windows printer OR save as HTML (test mode)
- Mark as processed and continue monitoring
GUI Theme (VS Code-inspired)
- Primary Blue:
#007acc - Dark Background:
#1e1e1e - Control Background:
#252526 - Foreground:
#cccccc - Color-coded logging (green=success, red=error, yellow=warning)
Deployment Strategy
Standalone Executable (PyInstaller)
pyinstaller --onefile --windowed --icon=logo.ico --add-data "logo.png;." maws_printer.py
Features:
- Single executable file
- Embedded logo asset
- No console window (windowed mode)
- Custom icon
Installation & Usage
Development Setup
# Install Python 3.x
pip install pywin32 pillow
# Run application
python maws_printer.py
Configuration Steps
- Enter IMAP server (default:
imap.gmail.com) - Enter email address
- Enter app-specific password (Gmail App Password required)
- Select target printer from dropdown
- Save configuration
- Click "Start Monitoring"
Test Mode
- Enable checkbox before starting
- Creates
captured_prints/directory - Saves emails as timestamped HTML files
- No actual printing occurs
Security Considerations
- Credentials stored in plaintext JSON (local config file)
- Gmail requires App Password (not account password)
- IMAP connection uses SSL/TLS encryption
- Windows-only (requires local printer access)
Known Limitations
- Windows-only (pywin32 dependency)
- Gmail-focused (IMAP configuration required for other providers)
- Plaintext storage of credentials (no encryption)
- No multi-account support (single email configuration)
- HTML-only printing (no attachment support)
- Date-based filtering (only processes emails from current day)
Notes
Repository Statistics
- 3 commits to main branch
- 5 files total
- 0 stars / 0 forks (initial release)
- No releases published yet
Key Design Decisions
- Tkinter over PyQt/Kivy: Minimizes dependencies, standard library
- JSON config: Simple, human-readable persistence
- Test mode: Reduces paper waste during development
- Thread-based monitoring: Prevents UI freezing
- HTML generation: Ensures consistent formatting across printers
- VS Code theme: Modern, professional aesthetic
Future Enhancement Ideas
- Encryption for stored credentials
- Multi-account support
- Attachment printing capability
- Email filtering rules (subject/sender)
- Cross-platform support (CUPS for Linux/Mac)
- Database storage instead of JSON
- Web interface option
- Email templates/formatting options
Resources & Links
- GitHub Repository: https://github.com/Maws7140/mawsprinter
- pywin32 Documentation: https://github.com/mhammond/pywin32
- Python IMAP Documentation: https://docs.python.org/3/library/imaplib.html
- Tkinter Documentation: https://docs.python.org/3/library/tkinter.html
Timeline
@card [color-green]
time: 2025-01-01
title: Initial Development
content:
Project started - Core email monitoring and printing functionality implemented
@card [color-blue]
time: 2025-01-05
title: GUI Implementation
content:
Dark-themed VS Code-inspired interface completed with real-time logging
@card [color-green]
time: 2025-01-08
title: Test Mode & Configuration
content:
Added test mode (HTML export) and JSON-based configuration persistence
@card [color-green]
time: 2025-01-10
title: Release
content:
Repository published to GitHub with PyInstaller executable support