- Replace placeholder message generation with actual IMAP message fetching using go-message library - Add per-account CouchDB databases for better organization and isolation - Implement native CouchDB attachment storage with proper revision management - Add command line argument parsing with --max-messages flag for controlling message processing limits - Support both sync and archive modes with proper document synchronization - Add comprehensive test environment with Podman containers (GreenMail IMAP server + CouchDB) - Implement full MIME multipart parsing for proper body and attachment extraction - Add TLS and plain IMAP connection support based on port configuration - Update configuration system to support sync vs archive modes - Create test scripts and sample data for development and testing Key technical improvements: - Real email envelope and header processing with go-imap v2 API - MIME Content-Type and Content-Disposition parsing for attachment detection - CouchDB document ID generation using mailbox_uid format for uniqueness - Duplicate detection and prevention to avoid re-storing existing messages - Proper error handling and connection management for IMAP operations 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
55 lines
No EOL
1.2 KiB
JSON
55 lines
No EOL
1.2 KiB
JSON
{
|
|
"couchDb": {
|
|
"url": "http://localhost:5984",
|
|
"user": "admin",
|
|
"password": "password",
|
|
"database": "mail_backup_test"
|
|
},
|
|
"mailSources": [
|
|
{
|
|
"name": "Test User 1",
|
|
"enabled": true,
|
|
"protocol": "imap",
|
|
"host": "localhost",
|
|
"port": 3143,
|
|
"user": "testuser1",
|
|
"password": "password123",
|
|
"mode": "archive",
|
|
"folderFilter": {
|
|
"include": ["INBOX", "Sent"],
|
|
"exclude": []
|
|
},
|
|
"messageFilter": {}
|
|
},
|
|
{
|
|
"name": "Test Sync User",
|
|
"enabled": true,
|
|
"protocol": "imap",
|
|
"host": "localhost",
|
|
"port": 3143,
|
|
"user": "syncuser",
|
|
"password": "syncpass",
|
|
"mode": "sync",
|
|
"folderFilter": {
|
|
"include": ["INBOX"],
|
|
"exclude": []
|
|
},
|
|
"messageFilter": {}
|
|
},
|
|
{
|
|
"name": "Test Archive User",
|
|
"enabled": true,
|
|
"protocol": "imap",
|
|
"host": "localhost",
|
|
"port": 3143,
|
|
"user": "archiveuser",
|
|
"password": "archivepass",
|
|
"mode": "archive",
|
|
"folderFilter": {
|
|
"include": [],
|
|
"exclude": ["Drafts"]
|
|
},
|
|
"messageFilter": {}
|
|
}
|
|
]
|
|
} |