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>
This commit is contained in:
Ole-Morten Duesund 2025-08-01 21:26:53 +02:00
commit c2ad55eaaf
17 changed files with 1139 additions and 111 deletions

View file

@ -1,12 +1,13 @@
#!/bin/bash
# Run integration tests with test containers
# Run basic integration tests with test containers
# This is a comprehensive test that handles its own setup and teardown
set -e
cd "$(dirname "$0")"
echo "🚀 Starting mail2couch integration tests..."
echo "🚀 Running basic integration tests..."
# Colors for output
RED='\033[0;31m'
@ -72,7 +73,7 @@ print_status "IMAP server is ready!"
# Populate test messages
print_status "Populating test messages..."
./populate-test-messages.sh
python3 ./populate-greenmail.py
# Build mail2couch
print_status "Building mail2couch..."
@ -82,13 +83,13 @@ cd ../test
# Run mail2couch with test configuration
print_status "Running mail2couch with test configuration..."
../go/mail2couch -config config-test.json
../go/mail2couch -config config-test.json -max-messages 3
# Verify results
print_status "Verifying test results..."
# Check CouchDB databases were created
EXPECTED_DBS=("test_user_1" "test_sync_user" "test_archive_user")
# Check CouchDB databases were created (using correct database names with m2c prefix)
EXPECTED_DBS=("m2c_wildcard_all_folders_test" "m2c_work_pattern_test" "m2c_specific_folders_only")
for db in "${EXPECTED_DBS[@]}"; do
if curl -s "http://admin:password@localhost:5984/$db" | grep -q "\"db_name\":\"$db\""; then
@ -109,20 +110,19 @@ for db in "${EXPECTED_DBS[@]}"; do
fi
done
# Test sync mode by running again (should show removed documents if any)
print_status "Running mail2couch again to test sync behavior..."
../go/mail2couch -config config-test.json
# Test sync mode by running again (should show incremental behavior)
print_status "Running mail2couch again to test incremental sync..."
../go/mail2couch -config config-test.json -max-messages 3
print_status "🎉 All tests completed successfully!"
print_status "🎉 Basic integration tests completed successfully!"
# Show summary
print_status "Test Summary:"
echo " - IMAP Server: localhost:143"
echo " - IMAP Server: localhost:3143"
echo " - CouchDB: http://localhost:5984"
echo " - Test accounts: testuser1, syncuser, archiveuser"
echo " - Databases created: ${EXPECTED_DBS[*]}"
echo ""
echo "You can now:"
echo " - Access CouchDB at http://localhost:5984/_utils"
echo " - Connect to IMAP at localhost:143"
echo " - Run manual tests with: ../go/mail2couch -config config-test.json"
echo "For more comprehensive tests, run:"
echo " - ./test-wildcard-patterns.sh (test folder pattern matching)"
echo " - ./test-incremental-sync.sh (test incremental synchronization)"