mail2couch/examples/sample-mail-document.json
Ole-Morten Duesund 651d95e98b docs: add comprehensive CouchDB schema documentation for cross-implementation compatibility
- Add complete CouchDB document schema specifications in couchdb-schemas.md
- Create example JSON documents for mail and sync metadata structures
- Implement Rust schema definitions with full serde support and type safety
- Add validation script to ensure schema consistency across implementations
- Document field definitions, data types, and validation rules
- Provide Rust Cargo.toml with appropriate dependencies for future implementation

This establishes a solid foundation for the planned Rust implementation while ensuring
100% compatibility with existing Go implementation databases. Both implementations will
use identical document structures, field names, and database naming conventions.

Schema Features:
- Mail documents with native CouchDB attachment support
- Sync metadata for incremental synchronization
- Predictable document ID patterns for efficient access
- Cross-language type mappings and validation rules
- Example documents for testing and reference

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-02 15:08:35 +02:00

42 lines
No EOL
1.3 KiB
JSON

{
"_id": "INBOX_123",
"_rev": "1-abc123def456789",
"_attachments": {
"report.pdf": {
"content_type": "application/pdf",
"length": 245760,
"stub": true
},
"image.png": {
"content_type": "image/png",
"length": 12345,
"stub": true
}
},
"sourceUid": "123",
"mailbox": "INBOX",
"from": ["sender@example.com", "alias@example.com"],
"to": ["recipient@company.com", "cc@company.com"],
"subject": "Monthly Report - Q3 2025",
"date": "2025-08-02T12:16:10Z",
"body": "Please find the attached monthly report for Q3 2025.\n\nBest regards,\nSender Name",
"headers": {
"Content-Type": ["multipart/mixed; boundary=\"----=_Part_123456\""],
"Content-Transfer-Encoding": ["7bit"],
"Date": ["Sat, 02 Aug 2025 14:16:10 +0200"],
"From": ["sender@example.com"],
"To": ["recipient@company.com"],
"Cc": ["cc@company.com"],
"Subject": ["Monthly Report - Q3 2025"],
"Message-ID": ["<msg123.456@example.com>"],
"MIME-Version": ["1.0"],
"X-Mailer": ["Mail Client 1.0"],
"Return-Path": ["<sender@example.com>"],
"Received": [
"from smtp.example.com (smtp.example.com [192.168.1.100]) by mx.company.com (Postfix) with ESMTP id ABC123; Sat, 02 Aug 2025 14:16:10 +0200"
]
},
"storedAt": "2025-08-02T14:16:22.375241322+02:00",
"docType": "mail",
"hasAttachments": true
}