changed dir
This commit is contained in:
parent
df37f59ff9
commit
8a04151bd2
|
|
@ -19,7 +19,7 @@ RUN pip install --no-cache-dir -r /app/requirements.txt
|
||||||
|
|
||||||
# Worker code (all modules)
|
# Worker code (all modules)
|
||||||
COPY --chown=worker:worker aws/ /app/aws/
|
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 smtp/ /app/smtp/
|
||||||
COPY --chown=worker:worker metrics/ /app/metrics/
|
COPY --chown=worker:worker metrics/ /app/metrics/
|
||||||
COPY --chown=worker:worker *.py /app/
|
COPY --chown=worker:worker *.py /app/
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,7 @@
|
||||||
- `get_blocked_patterns()`: Single recipient
|
- `get_blocked_patterns()`: Single recipient
|
||||||
- `batch_get_blocked_patterns()`: Multiple recipients (efficient!)
|
- `batch_get_blocked_patterns()`: Multiple recipients (efficient!)
|
||||||
|
|
||||||
### Email Processors (`email/`)
|
### Email Processors (`email_processing/`)
|
||||||
|
|
||||||
#### `parser.py`
|
#### `parser.py`
|
||||||
- **Purpose**: Email parsing utilities
|
- **Purpose**: Email parsing utilities
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
@ -65,7 +65,7 @@ Die modulare Version ist **vollständig kompatibel** mit deinem bestehenden Setu
|
||||||
│ ├── sqs_handler.py
|
│ ├── sqs_handler.py
|
||||||
│ ├── ses_handler.py
|
│ ├── ses_handler.py
|
||||||
│ └── dynamodb_handler.py
|
│ └── dynamodb_handler.py
|
||||||
├── email/
|
├── email_processing/
|
||||||
│ ├── parser.py
|
│ ├── parser.py
|
||||||
│ ├── bounce_handler.py
|
│ ├── bounce_handler.py
|
||||||
│ ├── blocklist.py
|
│ ├── blocklist.py
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ email-worker/
|
||||||
│ ├── sqs_handler.py # SQS polling
|
│ ├── sqs_handler.py # SQS polling
|
||||||
│ ├── ses_handler.py # SES email sending
|
│ ├── ses_handler.py # SES email sending
|
||||||
│ └── dynamodb_handler.py # DynamoDB (rules, bounces, blocklist)
|
│ └── dynamodb_handler.py # DynamoDB (rules, bounces, blocklist)
|
||||||
├── email/ # Email processing
|
├── email_processing/ # Email processing
|
||||||
│ ├── parser.py # Email parsing utilities
|
│ ├── parser.py # Email parsing utilities
|
||||||
│ ├── bounce_handler.py # Bounce detection & rewriting
|
│ ├── bounce_handler.py # Bounce detection & rewriting
|
||||||
│ ├── rules_processor.py # OOO & forwarding logic
|
│ ├── rules_processor.py # OOO & forwarding logic
|
||||||
|
|
|
||||||
|
|
@ -95,10 +95,10 @@ After: 27 files, ~150 lines each
|
||||||
| `aws/sqs_handler.py` | SQS polling | 95 |
|
| `aws/sqs_handler.py` | SQS polling | 95 |
|
||||||
| `aws/ses_handler.py` | SES sending | 45 |
|
| `aws/ses_handler.py` | SES sending | 45 |
|
||||||
| `aws/dynamodb_handler.py` | DynamoDB access | 175 |
|
| `aws/dynamodb_handler.py` | DynamoDB access | 175 |
|
||||||
| `email/parser.py` | Email parsing | 75 |
|
| `email_processing/parser.py` | Email parsing | 75 |
|
||||||
| `email/bounce_handler.py` | Bounce detection | 95 |
|
| `email_processing/bounce_handler.py` | Bounce detection | 95 |
|
||||||
| `email/blocklist.py` | Sender blocking | 90 |
|
| `email_processing/blocklist.py` | Sender blocking | 90 |
|
||||||
| `email/rules_processor.py` | OOO & forwarding | 285 |
|
| `email_processing/rules_processor.py` | OOO & forwarding | 285 |
|
||||||
| `smtp/pool.py` | Connection pooling | 110 |
|
| `smtp/pool.py` | Connection pooling | 110 |
|
||||||
| `smtp/delivery.py` | SMTP/LMTP delivery | 165 |
|
| `smtp/delivery.py` | SMTP/LMTP delivery | 165 |
|
||||||
| `metrics/prometheus.py` | Metrics collection | 140 |
|
| `metrics/prometheus.py` | Metrics collection | 140 |
|
||||||
|
|
@ -140,7 +140,7 @@ After: 27 files, ~150 lines each
|
||||||
Adding new features is now easy:
|
Adding new features is now easy:
|
||||||
|
|
||||||
**Example: Add DKIM Signing**
|
**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)`
|
2. Add to `worker.py`: `signed_bytes = dkim.sign(raw_bytes)`
|
||||||
3. Done! No touching 800-line monolith
|
3. Done! No touching 800-line monolith
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ from logger import log
|
||||||
from config import config, is_internal_address
|
from config import config, is_internal_address
|
||||||
from aws.dynamodb_handler import DynamoDBHandler
|
from aws.dynamodb_handler import DynamoDBHandler
|
||||||
from aws.ses_handler import SESHandler
|
from aws.ses_handler import SESHandler
|
||||||
from email.parser import EmailParser
|
from email_processing.parser import EmailParser
|
||||||
|
|
||||||
|
|
||||||
class RulesProcessor:
|
class RulesProcessor:
|
||||||
|
|
@ -11,7 +11,7 @@ from typing import List, Tuple
|
||||||
from logger import log
|
from logger import log
|
||||||
from config import config, domain_to_bucket_name
|
from config import config, domain_to_bucket_name
|
||||||
from aws import S3Handler, SQSHandler, SESHandler, DynamoDBHandler
|
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 smtp.delivery import EmailDelivery
|
||||||
from metrics.prometheus import MetricsCollector
|
from metrics.prometheus import MetricsCollector
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue