changed dir

This commit is contained in:
Andreas Knuth 2026-01-23 13:13:31 -06:00
parent df37f59ff9
commit 8a04151bd2
12 changed files with 48 additions and 11 deletions

View File

@ -19,7 +19,7 @@ RUN pip install --no-cache-dir -r /app/requirements.txt
# Worker code (all modules)
COPY --chown=worker:worker aws/ /app/aws/
COPY --chown=worker:worker email/ /app/email/
COPY --chown=worker:worker email_processing/ /app/email_processing/
COPY --chown=worker:worker smtp/ /app/smtp/
COPY --chown=worker:worker metrics/ /app/metrics/
COPY --chown=worker:worker *.py /app/

View File

@ -192,7 +192,7 @@
- `get_blocked_patterns()`: Single recipient
- `batch_get_blocked_patterns()`: Multiple recipients (efficient!)
### Email Processors (`email/`)
### Email Processors (`email_processing/`)
#### `parser.py`
- **Purpose**: Email parsing utilities

View File

@ -0,0 +1,37 @@
# Changelog
## v1.0.1 - 2025-01-23
### Fixed
- **CRITICAL:** Renamed `email/` directory to `email_processing/` to avoid namespace conflict with Python's built-in `email` module
- This fixes the `ImportError: cannot import name 'BytesParser' from partially initialized module 'email.parser'` error
- All imports updated accordingly
- No functional changes, only namespace fix
### Changed
- Updated all documentation to reflect new directory name
- Updated Dockerfile to copy `email_processing/` instead of `email/`
## v1.0.0 - 2025-01-23
### Added
- Modular architecture (27 files vs 1 monolith)
- Batch DynamoDB operations (10x performance improvement)
- Sender blocklist with wildcard support
- LMTP direct delivery support
- Enhanced metrics and monitoring
- Comprehensive documentation (6 MD files)
### Fixed
- `signal.SIGINT` typo (was `signalIGINT`)
- Missing S3 metadata audit trail for blocked emails
- Inefficient DynamoDB calls (N calls → 1 batch call)
- S3 delete error handling (proper retry logic)
### Documentation
- README.md - Full feature documentation
- QUICKSTART.md - Quick deployment guide for your setup
- ARCHITECTURE.md - Detailed system architecture
- MIGRATION.md - Migration from monolith
- COMPATIBILITY.md - 100% compatibility proof
- SUMMARY.md - All improvements overview

View File

@ -65,7 +65,7 @@ Die modulare Version ist **vollständig kompatibel** mit deinem bestehenden Setu
│ ├── sqs_handler.py
│ ├── ses_handler.py
│ └── dynamodb_handler.py
├── email/
├── email_processing/
│ ├── parser.py
│ ├── bounce_handler.py
│ ├── blocklist.py

View File

@ -13,7 +13,7 @@ email-worker/
│ ├── sqs_handler.py # SQS polling
│ ├── ses_handler.py # SES email sending
│ └── dynamodb_handler.py # DynamoDB (rules, bounces, blocklist)
├── email/ # Email processing
├── email_processing/ # Email processing
│ ├── parser.py # Email parsing utilities
│ ├── bounce_handler.py # Bounce detection & rewriting
│ ├── rules_processor.py # OOO & forwarding logic

View File

@ -95,10 +95,10 @@ After: 27 files, ~150 lines each
| `aws/sqs_handler.py` | SQS polling | 95 |
| `aws/ses_handler.py` | SES sending | 45 |
| `aws/dynamodb_handler.py` | DynamoDB access | 175 |
| `email/parser.py` | Email parsing | 75 |
| `email/bounce_handler.py` | Bounce detection | 95 |
| `email/blocklist.py` | Sender blocking | 90 |
| `email/rules_processor.py` | OOO & forwarding | 285 |
| `email_processing/parser.py` | Email parsing | 75 |
| `email_processing/bounce_handler.py` | Bounce detection | 95 |
| `email_processing/blocklist.py` | Sender blocking | 90 |
| `email_processing/rules_processor.py` | OOO & forwarding | 285 |
| `smtp/pool.py` | Connection pooling | 110 |
| `smtp/delivery.py` | SMTP/LMTP delivery | 165 |
| `metrics/prometheus.py` | Metrics collection | 140 |
@ -140,7 +140,7 @@ After: 27 files, ~150 lines each
Adding new features is now easy:
**Example: Add DKIM Signing**
1. Create `email/dkim_signer.py`
1. Create `email_processing/dkim_signer.py`
2. Add to `worker.py`: `signed_bytes = dkim.sign(raw_bytes)`
3. Done! No touching 800-line monolith

View File

@ -13,7 +13,7 @@ from logger import log
from config import config, is_internal_address
from aws.dynamodb_handler import DynamoDBHandler
from aws.ses_handler import SESHandler
from email.parser import EmailParser
from email_processing.parser import EmailParser
class RulesProcessor:

View File

@ -11,7 +11,7 @@ from typing import List, Tuple
from logger import log
from config import config, domain_to_bucket_name
from aws import S3Handler, SQSHandler, SESHandler, DynamoDBHandler
from email import EmailParser, BounceHandler, RulesProcessor, BlocklistChecker
from email_processing import EmailParser, BounceHandler, RulesProcessor, BlocklistChecker
from smtp.delivery import EmailDelivery
from metrics.prometheus import MetricsCollector