refactor: remove webmail interface, focus on core mail storage functionality

- Remove obsolete CouchDB design documents (webmail.json, dashboard.json)
- Clean up webmail-related code from couch/couch.go (WebmailViews, CreateWebmailViews, etc.)
- Update documentation to focus on core mail-to-CouchDB storage functionality
- Add Future Plans section describing planned webmail viewer as separate component
- Apply go fmt formatting and ensure code quality standards
- Update test documentation to show raw CouchDB API access patterns
- Remove compiled binary from repository

This refactor simplifies the codebase to focus on its core purpose: efficiently
backing up emails from IMAP to CouchDB. The webmail interface will be developed
as a separate, optional component to maintain clean separation of concerns.

🤖 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-02 14:57:51 +02:00
commit e280aa0aaa
12 changed files with 147 additions and 49 deletions

View file

@ -8,6 +8,7 @@ The test environment provides:
- **CouchDB**: Database for storing email messages
- **GreenMail IMAP Server**: Java-based mail server designed for testing with pre-populated test accounts and messages
- **Test Configuration**: Ready-to-use config for testing both sync and archive modes
- **HTML Webmail Interface**: Beautiful, responsive web interface for viewing archived emails
## Quick Start
@ -114,6 +115,20 @@ Each account contains:
- **SMTP Port**: 3025
- **Server**: GreenMail (Java-based test server)
### Accessing Test Data
After running mail2couch, you can access the stored emails via CouchDB's REST API:
**📋 Database Access:**
- All databases: http://localhost:5984/_all_dbs
- Specific database: http://localhost:5984/m2c_specific_folders_only
- All documents: http://localhost:5984/m2c_specific_folders_only/_all_docs
- Individual message: http://localhost:5984/m2c_specific_folders_only/INBOX_12
**🔍 Raw Data Examples:**
- Database info: http://localhost:5984/m2c_specific_folders_only
- Document content: http://localhost:5984/m2c_specific_folders_only/INBOX_1
- Email attachments: http://localhost:5984/m2c_specific_folders_only/INBOX_1/{attachment_name}
## Database Structure
mail2couch will create separate databases for each mail source (with `m2c_` prefix):
@ -126,6 +141,7 @@ Each database contains documents with:
- `mailbox` field indicating the origin folder
- Native CouchDB attachments for email attachments
- Full message headers and body content
- JSON documents accessible via CouchDB REST API
## Testing Sync vs Archive Modes

View file

@ -63,5 +63,18 @@ echo ""
echo "To run mail2couch:"
echo " cd ../go && ./mail2couch -config ../test/config-test.json"
echo ""
echo "📧 MAIL2COUCH DATABASE ACCESS:"
echo "After running mail2couch, you can access the stored emails via CouchDB:"
echo ""
echo "📋 Database Access (examples after sync):"
echo " - All databases: http://localhost:5984/_all_dbs"
echo " - Specific database: http://localhost:5984/m2c_specific_folders_only"
echo " - All documents: http://localhost:5984/m2c_specific_folders_only/_all_docs"
echo " - Individual message: http://localhost:5984/m2c_specific_folders_only/INBOX_12"
echo ""
echo "🔍 Raw Data Access:"
echo " - Database info: http://localhost:5984/m2c_specific_folders_only"
echo " - Document with content: http://localhost:5984/m2c_specific_folders_only/INBOX_12"
echo ""
echo "To stop the environment:"
echo " ./stop-test-env.sh"

View file

@ -81,7 +81,17 @@ add_new_messages() {
import imaplib
import time
from test.populate_greenmail import create_simple_message
import sys
import os
# Add the test directory to Python path to enable imports
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import importlib.util
spec = importlib.util.spec_from_file_location("populate_greenmail", "populate-greenmail.py")
populate_greenmail = importlib.util.module_from_spec(spec)
spec.loader.exec_module(populate_greenmail)
create_simple_message = populate_greenmail.create_simple_message
def add_new_messages():
"""Add new messages to test incremental sync"""