How itsnotgoodname/smtpbridge works
Main Components
a. Input Services Layer:
• SMTP Server (smtp/*)
• HTTP Server (web/http/*)
• IMAP Server (imap/*)
b. Core Processing Layer:
• Envelope Processing System (internal/envelope/*)
• Rule Engine (internal/rule/*)
• Message Queue System (internal/mailman/*)
c. Output Services Layer:
• Endpoint System (internal/endpoint/*)
• Multiple Senders (internal/senders/*)
• Telegram
• Shoutrrr
• Apprise
• Console
• Script
d. Storage Layer:
• Database (internal/database/*)
• File Storage (internal/file/*)
e. Supporting Systems:
• Authentication System (internal/auth/*)
• Retention Policy Manager (internal/retention/*)
• Trace/Logging System (internal/trace/*)
• Health Check System
[Input Layer]
• ↓
[Core Layer]
• ↓
[Output Layer]
• ↑
[Storage Layer]
Component Relationships
• Email → SMTP/HTTP Server → Envelope Processing
• Envelope Processing → Rule Engine → Message Queue
• Message Queue → Endpoint System → Various Senders
• All components ↔ Storage Layer
• All components → Trace System
Important Details
a. Configuration Elements:
• Config file locations
• Authentication points
• Health check endpoints
b. Key Processing Flows:
• Email reception flow
• Rule matching process
• Message delivery pipeline
• Retention policy execution
Technical Specifications to Note
• Supported protocols (SMTP, HTTP, IMAP)
• Authentication points
• Template processing points
• Where rules are evaluated
Implementation Notes
• The modular nature of the sender system
• The template-based message processing
• The rule-based routing system
• The retention policy mechanism
Special Attention Areas
• Separation between email reception and message delivery
• How the rule engine interfaces with both envelope processing and endpoint selection
• Queue-based nature of the mailman system
• Demonstrate how the retention policy affects both database and file storage
This system design should reflect the application's primary purpose of bridging email communications to various messaging services while maintaining a clear separation of concerns and robust processing pipeline.