This commit is contained in:
2025-05-28 11:39:54 +00:00
parent 0e610cba16
commit 77ff948404
10 changed files with 677 additions and 344 deletions

View File

@ -662,6 +662,22 @@ The email architecture consolidation has been fully completed. Contrary to the i
- Pooled SMTP clients managed centrally in UnifiedEmailServer
- Clean separation of concerns between routing (DcRouter) and email handling (UnifiedEmailServer)
## Email Router Architecture Decision (2025-05-28)
### Single Router Class
- **Important**: We will have only ONE router class, not two
- The existing `DomainRouter` will be evolved into `EmailRouter`
- This avoids confusion and redundancy
- Use `git mv` to rename and preserve git history
- Extend it to support the new match/action pattern inspired by SmartProxy
- Maintain backward compatibility for legacy domain-based rules
### Benefits of Single Router
- Clear, single source of truth for routing logic
- No confusion about which router to use
- Preserved git history and gradual migration path
- Supports all match criteria (not just domains)
## Email Routing Architecture (2025-05-27)
### Current Routing Capabilities
@ -696,4 +712,33 @@ The email architecture consolidation has been fully completed. Contrary to the i
- `ts/mail/routing/classes.domain.router.ts` - Pattern matching engine
- `ts/mail/routing/classes.unified.email.server.ts` - processEmailByMode()
- `ts/mail/routing/classes.email.config.ts` - Rule interfaces
- `ts/mail/delivery/classes.delivery.system.ts` - Delivery execution
- `ts/mail/delivery/classes.delivery.system.ts` - Delivery execution
## Configuration System Cleanup (2025-05-27) - COMPLETED
### Overview
The `ts/config/` directory cleanup has been completed. Removed ~500+ lines of unused legacy configuration code.
### Changes Made
✅ **Removed Files:**
- `base.config.ts` - All unused base interfaces
- `platform.config.ts` - Completely unused platform config
- `email.config.ts` - Deprecated email configuration
- `email.port.mapping.ts` - Unused port mapping utilities
- `schemas.ts` - Removed all schemas except SMS
- `sms.config.ts` - Moved to SMS module
✅ **SMS Configuration Moved:**
- Created `ts/sms/config/sms.config.ts` - ISmsConfig interface
- Created `ts/sms/config/sms.schema.ts` - Validation schema
- Updated SmsService to import from new location
✅ **Kept:**
- `validator.ts` - Generic validation utility (might move to utils later)
- `index.ts` - Now only exports ConfigValidator
### Result
- Config directory now contains only 2 files (validator.ts, index.ts)
- SMS configuration is self-contained in SMS module
- All deprecated email configuration removed
- Build passes successfully