- 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>
28 lines
No EOL
780 B
Bash
Executable file
28 lines
No EOL
780 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# Generate SSL certificates for Dovecot testing
|
|
|
|
set -e
|
|
|
|
CERT_DIR="dovecot/ssl"
|
|
mkdir -p "$CERT_DIR"
|
|
|
|
# Generate DH parameters
|
|
echo "Generating DH parameters..."
|
|
openssl dhparam -out "$CERT_DIR/dh.pem" 2048
|
|
|
|
# Generate private key
|
|
echo "Generating private key..."
|
|
openssl genrsa -out "$CERT_DIR/server.key" 2048
|
|
|
|
# Generate certificate signing request
|
|
echo "Generating certificate..."
|
|
openssl req -new -key "$CERT_DIR/server.key" -out "$CERT_DIR/server.csr" -subj "/C=US/ST=Test/L=Test/O=Mail2Couch/CN=localhost"
|
|
|
|
# Generate self-signed certificate
|
|
openssl x509 -req -days 365 -in "$CERT_DIR/server.csr" -signkey "$CERT_DIR/server.key" -out "$CERT_DIR/server.crt"
|
|
|
|
# Clean up CSR
|
|
rm "$CERT_DIR/server.csr"
|
|
|
|
echo "SSL certificates generated successfully in $CERT_DIR/" |