2025-07-29 17:18:20 +02:00
|
|
|
# CLAUDE.md
|
|
|
|
|
|
|
|
|
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
|
|
|
|
|
|
|
|
## Project Overview
|
|
|
|
|
|
|
|
|
|
mail2couch is a utility for backing up mail from various sources (primarily IMAP) to CouchDB. The project supports two implementations:
|
|
|
|
|
- **Go implementation**: Located in `/go/` directory (currently the active implementation)
|
|
|
|
|
- **Rust implementation**: Planned but not yet implemented
|
|
|
|
|
|
|
|
|
|
## Development Commands
|
|
|
|
|
|
|
|
|
|
### Go Implementation (Primary)
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# Build the application
|
|
|
|
|
cd go && go build -o mail2couch .
|
|
|
|
|
|
|
|
|
|
# Run the application with automatic config discovery
|
|
|
|
|
cd go && ./mail2couch
|
|
|
|
|
|
|
|
|
|
# Run with specific config file
|
|
|
|
|
cd go && ./mail2couch -config /path/to/config.json
|
|
|
|
|
|
2025-08-01 17:04:10 +02:00
|
|
|
# Run with message limit (useful for large mailboxes)
|
|
|
|
|
cd go && ./mail2couch -max-messages 100
|
|
|
|
|
|
|
|
|
|
# Run with both config and message limit
|
|
|
|
|
cd go && ./mail2couch -config /path/to/config.json -max-messages 50
|
|
|
|
|
|
2025-07-29 17:18:20 +02:00
|
|
|
# Run linting/static analysis
|
|
|
|
|
cd go && go vet ./...
|
|
|
|
|
|
feat: add comprehensive README documentation and clean up configuration
## Documentation Enhancements
- Create comprehensive README with installation, configuration, and usage examples
- Add simple, advanced, and provider-specific configuration examples
- Document all features: incremental sync, wildcard patterns, keyword filtering, attachment support
- Include production deployment guidance and troubleshooting section
- Add architecture documentation with database structure and document format examples
## Configuration Cleanup
- Remove unnecessary `database` field from CouchDB configuration
- Add `m2c_` prefix to all CouchDB database names for better namespace isolation
- Update GenerateAccountDBName() to consistently prefix databases with `m2c_`
- Clean up all configuration examples to remove deprecated database field
## Test Environment Simplification
- Simplify test script structure to eliminate confusion and redundancy
- Remove redundant populate-test-messages.sh wrapper script
- Update run-tests.sh to be comprehensive automated test with cleanup
- Maintain clear separation: automated tests vs manual testing environment
- Update all test scripts to expect m2c-prefixed database names
## Configuration Examples Added
- config-simple.json: Basic single Gmail account setup
- config-advanced.json: Multi-account with complex filtering and different providers
- config-providers.json: Real-world configurations for Gmail, Outlook, Yahoo, iCloud
## Benefits
- Clear documentation for users from beginner to advanced
- Namespace isolation prevents database conflicts in shared CouchDB instances
- Simplified test workflow eliminates user confusion about which scripts to use
- Comprehensive examples cover common email provider configurations
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 21:26:53 +02:00
|
|
|
# Run integration tests with Podman containers
|
|
|
|
|
cd test && ./run-tests.sh
|
|
|
|
|
|
|
|
|
|
# Run specialized tests
|
|
|
|
|
cd test && ./test-wildcard-patterns.sh
|
|
|
|
|
cd test && ./test-incremental-sync.sh
|
|
|
|
|
|
|
|
|
|
# Run unit tests (none currently implemented)
|
2025-07-29 17:18:20 +02:00
|
|
|
cd go && go test ./...
|
|
|
|
|
|
|
|
|
|
# Check dependencies
|
|
|
|
|
cd go && go mod tidy
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Architecture
|
|
|
|
|
|
|
|
|
|
### Core Components
|
|
|
|
|
|
|
|
|
|
1. **Configuration (`config/`)**: JSON-based configuration system
|
|
|
|
|
- Supports multiple mail sources with filtering options
|
|
|
|
|
- CouchDB connection settings
|
|
|
|
|
- Each source can have folder and message filters
|
|
|
|
|
|
|
|
|
|
2. **Mail Handling (`mail/`)**: IMAP client implementation
|
|
|
|
|
- Uses `github.com/emersion/go-imap/v2` for IMAP operations
|
|
|
|
|
- Supports TLS connections
|
2025-08-02 14:57:51 +02:00
|
|
|
- Fetches and processes email messages from IMAP mailboxes
|
2025-07-29 17:18:20 +02:00
|
|
|
|
|
|
|
|
3. **CouchDB Integration (`couch/`)**: Database operations
|
|
|
|
|
- Uses `github.com/go-kivik/kivik/v4` as CouchDB driver
|
|
|
|
|
- Handles database creation and document management
|
|
|
|
|
- Defines `MailDocument` structure for email storage
|
|
|
|
|
|
|
|
|
|
### Configuration Structure
|
|
|
|
|
|
|
|
|
|
The application uses `config.json` for configuration with the following structure:
|
feat: add comprehensive README documentation and clean up configuration
## Documentation Enhancements
- Create comprehensive README with installation, configuration, and usage examples
- Add simple, advanced, and provider-specific configuration examples
- Document all features: incremental sync, wildcard patterns, keyword filtering, attachment support
- Include production deployment guidance and troubleshooting section
- Add architecture documentation with database structure and document format examples
## Configuration Cleanup
- Remove unnecessary `database` field from CouchDB configuration
- Add `m2c_` prefix to all CouchDB database names for better namespace isolation
- Update GenerateAccountDBName() to consistently prefix databases with `m2c_`
- Clean up all configuration examples to remove deprecated database field
## Test Environment Simplification
- Simplify test script structure to eliminate confusion and redundancy
- Remove redundant populate-test-messages.sh wrapper script
- Update run-tests.sh to be comprehensive automated test with cleanup
- Maintain clear separation: automated tests vs manual testing environment
- Update all test scripts to expect m2c-prefixed database names
## Configuration Examples Added
- config-simple.json: Basic single Gmail account setup
- config-advanced.json: Multi-account with complex filtering and different providers
- config-providers.json: Real-world configurations for Gmail, Outlook, Yahoo, iCloud
## Benefits
- Clear documentation for users from beginner to advanced
- Namespace isolation prevents database conflicts in shared CouchDB instances
- Simplified test workflow eliminates user confusion about which scripts to use
- Comprehensive examples cover common email provider configurations
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 21:26:53 +02:00
|
|
|
- `couchDb`: Database connection settings (URL, credentials)
|
2025-07-29 17:18:20 +02:00
|
|
|
- `mailSources`: Array of mail sources with individual settings:
|
|
|
|
|
- Protocol support (currently only IMAP)
|
|
|
|
|
- Connection details (host, port, credentials)
|
2025-08-01 17:04:10 +02:00
|
|
|
- `mode`: Either "sync" or "archive" (defaults to "archive" if not specified)
|
|
|
|
|
- **sync**: 1-to-1 relationship - CouchDB documents match exactly what's in the mail account (may remove documents from CouchDB)
|
|
|
|
|
- **archive**: Archive mode - CouchDB keeps all messages ever seen, even if deleted from mail account (never removes documents)
|
feat: implement comprehensive wildcard folder selection and keyword filtering
## Wildcard Folder Selection
- Add support for wildcard patterns (`*`, `?`, `[abc]`) using filepath.Match
- Implement special case: `"*"` selects ALL available folders
- Support for complex include/exclude pattern combinations
- Maintain backwards compatibility with exact string matching
- Enable subfolder pattern matching (e.g., `Work/*`, `*/Drafts`)
## Keyword Filtering
- Add SubjectKeywords, SenderKeywords, RecipientKeywords to MessageFilter config
- Implement case-insensitive keyword matching across message fields
- Support multiple keywords per filter type with inclusive OR logic
- Add ShouldProcessMessage method for message-level filtering
## Enhanced Test Environment
- Create comprehensive wildcard pattern test scenarios
- Add 12 test folders covering various pattern types: Work/*, Important/*, Archive/*, exact matches
- Implement dedicated wildcard test script (test-wildcard-patterns.sh)
- Update test configurations to demonstrate real-world wildcard usage patterns
- Enhance test data generation with folder-specific messages for validation
## Documentation
- Create FOLDER_PATTERNS.md with comprehensive wildcard examples and use cases
- Update CLAUDE.md to reflect all implemented features and current status
- Enhance test README with detailed wildcard pattern explanations
- Provide configuration examples for common email organization scenarios
## Message Origin Tracking
- Verify all messages in CouchDB properly tagged with origin folder in `mailbox` field
- Maintain per-account database isolation for better organization
- Document ID format: `{folder}_{uid}` ensures uniqueness across folders
Key patterns supported:
- `["*"]` - All folders (with excludes)
- `["Work*", "Important*"]` - Prefix matching
- `["Work/*", "Archive/*"]` - Subfolder patterns
- `["INBOX", "Sent"]` - Exact matches
- Complex include/exclude combinations
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 17:24:02 +02:00
|
|
|
- Filtering options for folders and messages with wildcard support
|
2025-07-29 17:18:20 +02:00
|
|
|
- Enable/disable per source
|
|
|
|
|
|
|
|
|
|
### Configuration File Discovery
|
|
|
|
|
|
|
|
|
|
The application automatically searches for configuration files in the following order:
|
|
|
|
|
1. Path specified by `-config` command line flag
|
|
|
|
|
2. `./config.json` (current working directory)
|
|
|
|
|
3. `./config/config.json` (config subdirectory)
|
|
|
|
|
4. `~/.config/mail2couch/config.json` (user XDG config directory)
|
|
|
|
|
5. `~/.mail2couch.json` (user home directory)
|
|
|
|
|
|
|
|
|
|
This design ensures the same `config.json` format will work for both Go and Rust implementations.
|
|
|
|
|
|
|
|
|
|
### Current Implementation Status
|
|
|
|
|
|
|
|
|
|
- ✅ Configuration loading with automatic file discovery
|
|
|
|
|
- ✅ Command line flag support for config file path
|
2025-08-01 17:04:10 +02:00
|
|
|
- ✅ Per-account CouchDB database creation and management
|
2025-07-29 17:18:20 +02:00
|
|
|
- ✅ IMAP connection and mailbox listing
|
|
|
|
|
- ✅ Build error fixes
|
2025-08-02 14:57:51 +02:00
|
|
|
- ✅ Real IMAP message retrieval and parsing
|
2025-08-01 17:04:10 +02:00
|
|
|
- ✅ Email storage to CouchDB framework with native attachments
|
feat: implement comprehensive wildcard folder selection and keyword filtering
## Wildcard Folder Selection
- Add support for wildcard patterns (`*`, `?`, `[abc]`) using filepath.Match
- Implement special case: `"*"` selects ALL available folders
- Support for complex include/exclude pattern combinations
- Maintain backwards compatibility with exact string matching
- Enable subfolder pattern matching (e.g., `Work/*`, `*/Drafts`)
## Keyword Filtering
- Add SubjectKeywords, SenderKeywords, RecipientKeywords to MessageFilter config
- Implement case-insensitive keyword matching across message fields
- Support multiple keywords per filter type with inclusive OR logic
- Add ShouldProcessMessage method for message-level filtering
## Enhanced Test Environment
- Create comprehensive wildcard pattern test scenarios
- Add 12 test folders covering various pattern types: Work/*, Important/*, Archive/*, exact matches
- Implement dedicated wildcard test script (test-wildcard-patterns.sh)
- Update test configurations to demonstrate real-world wildcard usage patterns
- Enhance test data generation with folder-specific messages for validation
## Documentation
- Create FOLDER_PATTERNS.md with comprehensive wildcard examples and use cases
- Update CLAUDE.md to reflect all implemented features and current status
- Enhance test README with detailed wildcard pattern explanations
- Provide configuration examples for common email organization scenarios
## Message Origin Tracking
- Verify all messages in CouchDB properly tagged with origin folder in `mailbox` field
- Maintain per-account database isolation for better organization
- Document ID format: `{folder}_{uid}` ensures uniqueness across folders
Key patterns supported:
- `["*"]` - All folders (with excludes)
- `["Work*", "Important*"]` - Prefix matching
- `["Work/*", "Archive/*"]` - Subfolder patterns
- `["INBOX", "Sent"]` - Exact matches
- Complex include/exclude combinations
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 17:24:02 +02:00
|
|
|
- ✅ Folder filtering logic with wildcard support (`*`, `?`, `[abc]` patterns)
|
2025-07-29 17:18:20 +02:00
|
|
|
- ✅ Date filtering support
|
feat: implement comprehensive wildcard folder selection and keyword filtering
## Wildcard Folder Selection
- Add support for wildcard patterns (`*`, `?`, `[abc]`) using filepath.Match
- Implement special case: `"*"` selects ALL available folders
- Support for complex include/exclude pattern combinations
- Maintain backwards compatibility with exact string matching
- Enable subfolder pattern matching (e.g., `Work/*`, `*/Drafts`)
## Keyword Filtering
- Add SubjectKeywords, SenderKeywords, RecipientKeywords to MessageFilter config
- Implement case-insensitive keyword matching across message fields
- Support multiple keywords per filter type with inclusive OR logic
- Add ShouldProcessMessage method for message-level filtering
## Enhanced Test Environment
- Create comprehensive wildcard pattern test scenarios
- Add 12 test folders covering various pattern types: Work/*, Important/*, Archive/*, exact matches
- Implement dedicated wildcard test script (test-wildcard-patterns.sh)
- Update test configurations to demonstrate real-world wildcard usage patterns
- Enhance test data generation with folder-specific messages for validation
## Documentation
- Create FOLDER_PATTERNS.md with comprehensive wildcard examples and use cases
- Update CLAUDE.md to reflect all implemented features and current status
- Enhance test README with detailed wildcard pattern explanations
- Provide configuration examples for common email organization scenarios
## Message Origin Tracking
- Verify all messages in CouchDB properly tagged with origin folder in `mailbox` field
- Maintain per-account database isolation for better organization
- Document ID format: `{folder}_{uid}` ensures uniqueness across folders
Key patterns supported:
- `["*"]` - All folders (with excludes)
- `["Work*", "Important*"]` - Prefix matching
- `["Work/*", "Archive/*"]` - Subfolder patterns
- `["INBOX", "Sent"]` - Exact matches
- Complex include/exclude combinations
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 17:24:02 +02:00
|
|
|
- ✅ Keyword filtering support (subject, sender, recipient keywords)
|
2025-07-29 17:18:20 +02:00
|
|
|
- ✅ Duplicate detection and prevention
|
2025-08-01 17:04:10 +02:00
|
|
|
- ✅ Sync vs Archive mode implementation
|
|
|
|
|
- ✅ CouchDB attachment storage for email attachments
|
feat: implement comprehensive wildcard folder selection and keyword filtering
## Wildcard Folder Selection
- Add support for wildcard patterns (`*`, `?`, `[abc]`) using filepath.Match
- Implement special case: `"*"` selects ALL available folders
- Support for complex include/exclude pattern combinations
- Maintain backwards compatibility with exact string matching
- Enable subfolder pattern matching (e.g., `Work/*`, `*/Drafts`)
## Keyword Filtering
- Add SubjectKeywords, SenderKeywords, RecipientKeywords to MessageFilter config
- Implement case-insensitive keyword matching across message fields
- Support multiple keywords per filter type with inclusive OR logic
- Add ShouldProcessMessage method for message-level filtering
## Enhanced Test Environment
- Create comprehensive wildcard pattern test scenarios
- Add 12 test folders covering various pattern types: Work/*, Important/*, Archive/*, exact matches
- Implement dedicated wildcard test script (test-wildcard-patterns.sh)
- Update test configurations to demonstrate real-world wildcard usage patterns
- Enhance test data generation with folder-specific messages for validation
## Documentation
- Create FOLDER_PATTERNS.md with comprehensive wildcard examples and use cases
- Update CLAUDE.md to reflect all implemented features and current status
- Enhance test README with detailed wildcard pattern explanations
- Provide configuration examples for common email organization scenarios
## Message Origin Tracking
- Verify all messages in CouchDB properly tagged with origin folder in `mailbox` field
- Maintain per-account database isolation for better organization
- Document ID format: `{folder}_{uid}` ensures uniqueness across folders
Key patterns supported:
- `["*"]` - All folders (with excludes)
- `["Work*", "Important*"]` - Prefix matching
- `["Work/*", "Archive/*"]` - Subfolder patterns
- `["INBOX", "Sent"]` - Exact matches
- Complex include/exclude combinations
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 17:24:02 +02:00
|
|
|
- ✅ Full message body and attachment handling with MIME multipart support
|
|
|
|
|
- ✅ Command line argument support (--max-messages flag)
|
|
|
|
|
- ✅ Per-account CouchDB databases for better organization
|
feat: add comprehensive README documentation and clean up configuration
## Documentation Enhancements
- Create comprehensive README with installation, configuration, and usage examples
- Add simple, advanced, and provider-specific configuration examples
- Document all features: incremental sync, wildcard patterns, keyword filtering, attachment support
- Include production deployment guidance and troubleshooting section
- Add architecture documentation with database structure and document format examples
## Configuration Cleanup
- Remove unnecessary `database` field from CouchDB configuration
- Add `m2c_` prefix to all CouchDB database names for better namespace isolation
- Update GenerateAccountDBName() to consistently prefix databases with `m2c_`
- Clean up all configuration examples to remove deprecated database field
## Test Environment Simplification
- Simplify test script structure to eliminate confusion and redundancy
- Remove redundant populate-test-messages.sh wrapper script
- Update run-tests.sh to be comprehensive automated test with cleanup
- Maintain clear separation: automated tests vs manual testing environment
- Update all test scripts to expect m2c-prefixed database names
## Configuration Examples Added
- config-simple.json: Basic single Gmail account setup
- config-advanced.json: Multi-account with complex filtering and different providers
- config-providers.json: Real-world configurations for Gmail, Outlook, Yahoo, iCloud
## Benefits
- Clear documentation for users from beginner to advanced
- Namespace isolation prevents database conflicts in shared CouchDB instances
- Simplified test workflow eliminates user confusion about which scripts to use
- Comprehensive examples cover common email provider configurations
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 21:26:53 +02:00
|
|
|
- ✅ Incremental sync functionality with IMAP SEARCH and sync metadata tracking
|
2025-07-29 17:18:20 +02:00
|
|
|
- ❌ Rust implementation
|
|
|
|
|
|
|
|
|
|
### Key Dependencies
|
|
|
|
|
|
|
|
|
|
- `github.com/emersion/go-imap/v2`: IMAP client library
|
|
|
|
|
- `github.com/go-kivik/kivik/v4`: CouchDB client library
|
|
|
|
|
|
feat: add comprehensive README documentation and clean up configuration
## Documentation Enhancements
- Create comprehensive README with installation, configuration, and usage examples
- Add simple, advanced, and provider-specific configuration examples
- Document all features: incremental sync, wildcard patterns, keyword filtering, attachment support
- Include production deployment guidance and troubleshooting section
- Add architecture documentation with database structure and document format examples
## Configuration Cleanup
- Remove unnecessary `database` field from CouchDB configuration
- Add `m2c_` prefix to all CouchDB database names for better namespace isolation
- Update GenerateAccountDBName() to consistently prefix databases with `m2c_`
- Clean up all configuration examples to remove deprecated database field
## Test Environment Simplification
- Simplify test script structure to eliminate confusion and redundancy
- Remove redundant populate-test-messages.sh wrapper script
- Update run-tests.sh to be comprehensive automated test with cleanup
- Maintain clear separation: automated tests vs manual testing environment
- Update all test scripts to expect m2c-prefixed database names
## Configuration Examples Added
- config-simple.json: Basic single Gmail account setup
- config-advanced.json: Multi-account with complex filtering and different providers
- config-providers.json: Real-world configurations for Gmail, Outlook, Yahoo, iCloud
## Benefits
- Clear documentation for users from beginner to advanced
- Namespace isolation prevents database conflicts in shared CouchDB instances
- Simplified test workflow eliminates user confusion about which scripts to use
- Comprehensive examples cover common email provider configurations
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 21:26:53 +02:00
|
|
|
### Incremental Sync Implementation
|
|
|
|
|
|
|
|
|
|
The application implements intelligent incremental synchronization to avoid re-processing messages:
|
|
|
|
|
|
|
|
|
|
- **Sync Metadata Storage**: Each mailbox sync operation stores metadata including last sync timestamp and highest UID processed
|
|
|
|
|
- **IMAP SEARCH Integration**: Uses IMAP SEARCH with SINCE criteria for efficient server-side filtering of new messages
|
|
|
|
|
- **Per-Mailbox Tracking**: Sync state is tracked independently for each mailbox in each account
|
|
|
|
|
- **Fallback Behavior**: Gracefully falls back to fetching recent messages if IMAP SEARCH fails
|
|
|
|
|
- **First Sync Handling**: Initial sync can use config `since` date or perform full sync
|
|
|
|
|
|
|
|
|
|
Sync metadata documents are stored in CouchDB with ID format: `sync_metadata_{mailbox}` and include:
|
|
|
|
|
- `lastSyncTime`: When this mailbox was last successfully synced
|
|
|
|
|
- `lastMessageUID`: Highest UID processed in the last sync
|
|
|
|
|
- `messageCount`: Number of messages processed in the last sync
|
|
|
|
|
|
2025-07-29 17:18:20 +02:00
|
|
|
### Development Notes
|
|
|
|
|
|
|
|
|
|
- The main entry point is `main.go` which orchestrates the configuration loading, CouchDB setup, and mail source processing
|
feat: add comprehensive README documentation and clean up configuration
## Documentation Enhancements
- Create comprehensive README with installation, configuration, and usage examples
- Add simple, advanced, and provider-specific configuration examples
- Document all features: incremental sync, wildcard patterns, keyword filtering, attachment support
- Include production deployment guidance and troubleshooting section
- Add architecture documentation with database structure and document format examples
## Configuration Cleanup
- Remove unnecessary `database` field from CouchDB configuration
- Add `m2c_` prefix to all CouchDB database names for better namespace isolation
- Update GenerateAccountDBName() to consistently prefix databases with `m2c_`
- Clean up all configuration examples to remove deprecated database field
## Test Environment Simplification
- Simplify test script structure to eliminate confusion and redundancy
- Remove redundant populate-test-messages.sh wrapper script
- Update run-tests.sh to be comprehensive automated test with cleanup
- Maintain clear separation: automated tests vs manual testing environment
- Update all test scripts to expect m2c-prefixed database names
## Configuration Examples Added
- config-simple.json: Basic single Gmail account setup
- config-advanced.json: Multi-account with complex filtering and different providers
- config-providers.json: Real-world configurations for Gmail, Outlook, Yahoo, iCloud
## Benefits
- Clear documentation for users from beginner to advanced
- Namespace isolation prevents database conflicts in shared CouchDB instances
- Simplified test workflow eliminates user confusion about which scripts to use
- Comprehensive examples cover common email provider configurations
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 21:26:53 +02:00
|
|
|
- Each mail source gets its own CouchDB database named using `GenerateAccountDBName()` function with `m2c_` prefix
|
2025-07-29 17:18:20 +02:00
|
|
|
- Each mail source is processed sequentially with proper error handling
|
feat: add comprehensive README documentation and clean up configuration
## Documentation Enhancements
- Create comprehensive README with installation, configuration, and usage examples
- Add simple, advanced, and provider-specific configuration examples
- Document all features: incremental sync, wildcard patterns, keyword filtering, attachment support
- Include production deployment guidance and troubleshooting section
- Add architecture documentation with database structure and document format examples
## Configuration Cleanup
- Remove unnecessary `database` field from CouchDB configuration
- Add `m2c_` prefix to all CouchDB database names for better namespace isolation
- Update GenerateAccountDBName() to consistently prefix databases with `m2c_`
- Clean up all configuration examples to remove deprecated database field
## Test Environment Simplification
- Simplify test script structure to eliminate confusion and redundancy
- Remove redundant populate-test-messages.sh wrapper script
- Update run-tests.sh to be comprehensive automated test with cleanup
- Maintain clear separation: automated tests vs manual testing environment
- Update all test scripts to expect m2c-prefixed database names
## Configuration Examples Added
- config-simple.json: Basic single Gmail account setup
- config-advanced.json: Multi-account with complex filtering and different providers
- config-providers.json: Real-world configurations for Gmail, Outlook, Yahoo, iCloud
## Benefits
- Clear documentation for users from beginner to advanced
- Namespace isolation prevents database conflicts in shared CouchDB instances
- Simplified test workflow eliminates user confusion about which scripts to use
- Comprehensive examples cover common email provider configurations
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 21:26:53 +02:00
|
|
|
- The application uses real IMAP message parsing with go-message library for full email processing
|
|
|
|
|
- Message filtering by folder (wildcard patterns), date (since), and keywords is implemented
|
2025-07-29 17:18:20 +02:00
|
|
|
- Duplicate detection prevents re-storing existing messages
|
2025-08-01 17:04:10 +02:00
|
|
|
- Sync vs Archive mode determines whether to remove documents from CouchDB when they're no longer in the mail account
|
|
|
|
|
- Email attachments are stored as native CouchDB attachments linked to the email document
|
feat: add comprehensive README documentation and clean up configuration
## Documentation Enhancements
- Create comprehensive README with installation, configuration, and usage examples
- Add simple, advanced, and provider-specific configuration examples
- Document all features: incremental sync, wildcard patterns, keyword filtering, attachment support
- Include production deployment guidance and troubleshooting section
- Add architecture documentation with database structure and document format examples
## Configuration Cleanup
- Remove unnecessary `database` field from CouchDB configuration
- Add `m2c_` prefix to all CouchDB database names for better namespace isolation
- Update GenerateAccountDBName() to consistently prefix databases with `m2c_`
- Clean up all configuration examples to remove deprecated database field
## Test Environment Simplification
- Simplify test script structure to eliminate confusion and redundancy
- Remove redundant populate-test-messages.sh wrapper script
- Update run-tests.sh to be comprehensive automated test with cleanup
- Maintain clear separation: automated tests vs manual testing environment
- Update all test scripts to expect m2c-prefixed database names
## Configuration Examples Added
- config-simple.json: Basic single Gmail account setup
- config-advanced.json: Multi-account with complex filtering and different providers
- config-providers.json: Real-world configurations for Gmail, Outlook, Yahoo, iCloud
## Benefits
- Clear documentation for users from beginner to advanced
- Namespace isolation prevents database conflicts in shared CouchDB instances
- Simplified test workflow eliminates user confusion about which scripts to use
- Comprehensive examples cover common email provider configurations
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 21:26:53 +02:00
|
|
|
- Comprehensive test environment with Podman containers and automated test scripts
|
2025-07-29 17:18:20 +02:00
|
|
|
- The application uses automatic config file discovery as documented above
|
|
|
|
|
|
2025-08-02 14:57:51 +02:00
|
|
|
|
2025-07-29 17:18:20 +02:00
|
|
|
### Next Steps
|
|
|
|
|
|
feat: add comprehensive README documentation and clean up configuration
## Documentation Enhancements
- Create comprehensive README with installation, configuration, and usage examples
- Add simple, advanced, and provider-specific configuration examples
- Document all features: incremental sync, wildcard patterns, keyword filtering, attachment support
- Include production deployment guidance and troubleshooting section
- Add architecture documentation with database structure and document format examples
## Configuration Cleanup
- Remove unnecessary `database` field from CouchDB configuration
- Add `m2c_` prefix to all CouchDB database names for better namespace isolation
- Update GenerateAccountDBName() to consistently prefix databases with `m2c_`
- Clean up all configuration examples to remove deprecated database field
## Test Environment Simplification
- Simplify test script structure to eliminate confusion and redundancy
- Remove redundant populate-test-messages.sh wrapper script
- Update run-tests.sh to be comprehensive automated test with cleanup
- Maintain clear separation: automated tests vs manual testing environment
- Update all test scripts to expect m2c-prefixed database names
## Configuration Examples Added
- config-simple.json: Basic single Gmail account setup
- config-advanced.json: Multi-account with complex filtering and different providers
- config-providers.json: Real-world configurations for Gmail, Outlook, Yahoo, iCloud
## Benefits
- Clear documentation for users from beginner to advanced
- Namespace isolation prevents database conflicts in shared CouchDB instances
- Simplified test workflow eliminates user confusion about which scripts to use
- Comprehensive examples cover common email provider configurations
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 21:26:53 +02:00
|
|
|
The following enhancements could further improve the implementation:
|
|
|
|
|
|
|
|
|
|
1. **Error Recovery**: Add retry logic for network failures and partial sync recovery
|
|
|
|
|
2. **Performance Optimization**: Add batch operations for better CouchDB insertion performance
|
|
|
|
|
3. **Unit Testing**: Add comprehensive unit tests for all major components
|
|
|
|
|
4. **Advanced Filtering**: Add support for more complex filter expressions and regex patterns
|
|
|
|
|
5. **Monitoring**: Add metrics and logging for production deployment
|
|
|
|
|
6. **Configuration Validation**: Enhanced validation for configuration files
|
|
|
|
|
7. **Multi-threading**: Parallel processing of multiple mailboxes or accounts
|
2025-07-29 17:18:20 +02:00
|
|
|
|
|
|
|
|
## Development Guidelines
|
|
|
|
|
|
|
|
|
|
### Code Quality and Standards
|
2025-08-02 14:57:51 +02:00
|
|
|
- All code requires perfect linting and tool-formatting, exceptions are allowed only if documented properly
|
|
|
|
|
- We always want linting and formatting of our code to be perfect
|