feat: implement real IMAP message parsing with native CouchDB attachments
- Replace placeholder message generation with actual IMAP message fetching using go-message library - Add per-account CouchDB databases for better organization and isolation - Implement native CouchDB attachment storage with proper revision management - Add command line argument parsing with --max-messages flag for controlling message processing limits - Support both sync and archive modes with proper document synchronization - Add comprehensive test environment with Podman containers (GreenMail IMAP server + CouchDB) - Implement full MIME multipart parsing for proper body and attachment extraction - Add TLS and plain IMAP connection support based on port configuration - Update configuration system to support sync vs archive modes - Create test scripts and sample data for development and testing Key technical improvements: - Real email envelope and header processing with go-imap v2 API - MIME Content-Type and Content-Disposition parsing for attachment detection - CouchDB document ID generation using mailbox_uid format for uniqueness - Duplicate detection and prevention to avoid re-storing existing messages - Proper error handling and connection management for IMAP operations 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
79f19a8877
commit
ea6235b674
22 changed files with 1262 additions and 66 deletions
79
test/dovecot/dovecot.conf
Normal file
79
test/dovecot/dovecot.conf
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
# Dovecot configuration for testing mail2couch
|
||||
|
||||
# Basic settings
|
||||
protocols = imap
|
||||
listen = *
|
||||
|
||||
# SSL/TLS settings - make optional for easier testing
|
||||
ssl = optional
|
||||
ssl_cert = </etc/dovecot/ssl/server.crt
|
||||
ssl_key = </etc/dovecot/ssl/server.key
|
||||
|
||||
# Authentication
|
||||
auth_mechanisms = plain login
|
||||
disable_plaintext_auth = no
|
||||
|
||||
# User database
|
||||
passdb {
|
||||
driver = passwd-file
|
||||
args = scheme=plain username_format=%u /etc/dovecot/passwd
|
||||
}
|
||||
|
||||
userdb {
|
||||
driver = passwd-file
|
||||
args = username_format=%u /etc/dovecot/users
|
||||
}
|
||||
|
||||
# Mail location
|
||||
mail_location = maildir:/var/mail/%u
|
||||
|
||||
# Mailbox settings
|
||||
namespace inbox {
|
||||
type = private
|
||||
separator = /
|
||||
prefix =
|
||||
location =
|
||||
inbox = yes
|
||||
hidden = no
|
||||
list = yes
|
||||
subscriptions = yes
|
||||
|
||||
mailbox Drafts {
|
||||
special_use = \Drafts
|
||||
}
|
||||
mailbox Junk {
|
||||
special_use = \Junk
|
||||
}
|
||||
mailbox Trash {
|
||||
special_use = \Trash
|
||||
}
|
||||
mailbox Sent {
|
||||
special_use = \Sent
|
||||
}
|
||||
}
|
||||
|
||||
# Services
|
||||
service imap-login {
|
||||
inet_listener imap {
|
||||
port = 143
|
||||
}
|
||||
inet_listener imaps {
|
||||
port = 993
|
||||
ssl = yes
|
||||
}
|
||||
}
|
||||
|
||||
service auth {
|
||||
unix_listener auth-userdb {
|
||||
mode = 0666
|
||||
}
|
||||
}
|
||||
|
||||
# Logging
|
||||
log_path = /dev/stdout
|
||||
info_log_path = /dev/stdout
|
||||
debug_log_path = /dev/stdout
|
||||
|
||||
# Process limits
|
||||
default_process_limit = 10
|
||||
default_client_limit = 100
|
||||
Loading…
Add table
Add a link
Reference in a new issue