mail2couch/test/config-wildcard-examples.json

71 lines
1.6 KiB
JSON
Raw Normal View History

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
{
"couchDb": {
"url": "http://localhost:5984",
"user": "admin",
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
"password": "password"
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
},
"mailSources": [
{
"name": "All Folders Example",
"enabled": true,
"protocol": "imap",
"host": "localhost",
"port": 3143,
"user": "testuser1",
"password": "password123",
"mode": "archive",
"folderFilter": {
"include": ["*"],
"exclude": ["Drafts", "Trash", "Spam"]
},
"messageFilter": {}
},
{
"name": "Inbox and Sent Only",
"enabled": false,
"protocol": "imap",
"host": "localhost",
"port": 3143,
"user": "testuser2",
"password": "password456",
"mode": "sync",
"folderFilter": {
"include": ["INBOX", "Sent"],
"exclude": []
},
"messageFilter": {}
},
{
"name": "Work Folders Pattern",
"enabled": false,
"protocol": "imap",
"host": "localhost",
"port": 3143,
"user": "workuser",
"password": "workpass",
"mode": "archive",
"folderFilter": {
"include": ["Work*", "Projects*", "INBOX"],
"exclude": ["*Temp*", "*Draft*"]
},
"messageFilter": {
"senderKeywords": ["@company.com"]
}
},
{
"name": "Archive Pattern Example",
"enabled": false,
"protocol": "imap",
"host": "localhost",
"port": 3143,
"user": "archiveuser",
"password": "archivepass",
"mode": "archive",
"folderFilter": {
"include": ["Archive*", "*Important*", "INBOX"],
"exclude": ["*Temp"]
},
"messageFilter": {}
}
]
}