Skip to content

Releases: LSFLK/raven

Raven MDA v0.6.0

26 Mar 05:42
1e08a67

Choose a tag to compare

Raven MDA v0.6.0

What's New

✨ New Features

Socketmap Service (migrated from Silver)

The Socketmap service has been moved into the Raven repository, consolidating the full MDA stack in one place. This service implements the Postfix socketmap protocol with:

  • Alias resolution with caching
  • Domain existence validation against the Thunder IDP
  • Handlers for user existence checks and virtual domain lookups
  • Netstring protocol communication over TCP
  • Input sanitization and secure TLS configuration

Group Email Support (LMTP)

The LMTP server can now deliver mail to group/distribution addresses. Group email resolution integrates with the Thunder IDP to expand group addresses to individual recipients, including organization unit handling and user profile fetching.

Spam Restoration

When a message is unmarked as spam, it is now automatically restored to its original folder rather than remaining in the spam folder. This improves the user experience for false-positive spam corrections.

🔧 Improvements

IDP Responsibility Refactoring

Removed functionality from Raven that belongs to the Identity Provider (IDP). Key changes:

  • User identification is now email-based rather than user-ID-based across the IMAP server, middleware, and selection handlers.
  • Recipient existence checks are now delegated to the IDP rather than handled internally.
  • Role mailbox functions no longer require a domain_id parameter, simplifying the internal API.
  • Authentication flow updated to use username identifiers with improved domain-matching validation.

SASL Authentication Scope Configuration

The SASL server now supports explicit scope configuration to differentiate between TCP and Unix socket listeners. Validation is applied at startup to ensure the correct listener type is launched based on the configured scope.

🔒 Security

  • Improved error handling in configuration validation for SASL startup.
  • Secure TLS configuration enforced for HTTP clients communicating with Thunder IDP (resolving InsecureSkipVerify usage).
  • Workflow added to automatically update the security policy table on each release.

🐛 Bug Fixes

  • Fixed SASL authentication scope not being properly applied when switching between TCP and Unix socket modes.
  • Fixed silent failure in DB migration error handling during spam restoration.
  • Fixed import ordering issues in blobstorage and config packages.

Breaking Changes

  • Internal IMAP server interfaces now use email addresses instead of user IDs for database lookups. Any custom integrations against internal interfaces will need to be updated accordingly.
  • The domain_id parameter has been removed from role mailbox functions.

Docker

Pull the latest image:

docker pull ghcr.io/lsflk/raven:latest

The Socketmap service is now available as part of the Raven image and can be started via the entrypoint script.


What's Changed

# Type Description
#233 Bug Fix Configure SASL authentication scope for TCP vs Unix socket
#236 Bug Fix Restore messages to original folder when unmarked as spam
#238 Refactor Remove functionality that is the responsibility of the IDP
#243 Feature Add group email support to LMTP server
#245 Feature Move Socketmap service from Silver repo to Raven repo
#248 CI Fix GitHub token for welcome action
#240 CI Add workflow to update security policy on release

Contributors

Thank you to everyone who contributed to this release! 🎉

Contributor GitHub
H.W.K.Aravinda [@Aravinda-HWK](https://github.com/Aravinda-HWK)
Maneesha [@maneeshaxyz](https://github.com/maneeshaxyz)
Nazik [@MohamadNazik](https://github.com/MohamadNazik)

Full Changelog: v0.5.0...v0.6.0

Raven MDA v0.5.0

21 Feb 05:46
0136b19

Choose a tag to compare

Raven v0.5.0 Release Notes

Release Date: February 21, 2026

We're thrilled to announce Raven v0.5.0, a significant release focused on MIME handling improvements, containerization enhancements, security hardening, and comprehensive test coverage. This release brings major improvements to email parsing, especially for complex multipart messages with inline images and attachments.


🚀 Major Features

Advanced MIME Message Parser & Reconstruction

  • DFS-Based MIME Tree Reconstruction (#206): Completely redesigned MIME message reconstruction using Depth-First Search algorithm
    • Improved handling of complex multipart structures (multipart/mixed, multipart/related, multipart/alternative)
    • Dynamic multipart type detection for accurate message reconstruction
    • Proper ordering of HTML parts before inline resources in multipart/related
    • Better handling of inline images and embedded resources
  • Multipart/Related Enhancements (#209):
    • Preserved original part order for better email client compatibility
    • Enhanced debug logging for easier troubleshooting
    • Optimized parsing logic with reduced code complexity (226 lines removed)
  • Parser Improvements:
    • Replaced deprecated strings.Title with manual capitalization
    • Improved ParseMessage function for better readability
    • Enhanced S3 storage integration in message reconstruction

Key Benefits:

  • Correctly handles emails with multiple inline images
  • Maintains proper structure for HTML emails with embedded resources
  • Improved compatibility with various email clients
  • Better preservation of original message intent

Docker & Deployment Enhancements

  • Multi-Service Docker Images (#215): Created separate Docker images for each service
    • Individual images for IMAP, LMTP, and SASL services
    • Combined multi-service image for simplified deployment
    • Service-specific entrypoint scripts (entrypoint-imap.sh, entrypoint-lmtp.sh, entrypoint-sasl.sh)
    • Enhanced main entrypoint script with better service startup logic
  • Build System Improvements:
    • New Makefile targets for individual service builds
    • Automated version extraction from git tags
    • Comprehensive .dockerignore for optimized build context
    • Updated GitHub Actions workflow for multi-image releases

Deployment Options:

  • Single-service deployments for microservice architectures
  • All-in-one image for simplified setups
  • Better resource allocation per service
  • Improved container orchestration support

Consolidated Build Process

  • Streamlined Dockerfile (#203): Simplified build commands and reduced image layers
  • Unified Entrypoint: Single entrypoint script supporting all service modes
  • Improved Build Efficiency: Faster builds with better caching

🧪 Testing & Quality Improvements

Comprehensive S3 Storage Testing

  • S3 Unit Tests (#216): Added extensive test suite for S3 blob storage
    • Mock implementations for S3 client and blob storage interfaces
    • Tests for NewS3BlobStorage, Store, Retrieve, Delete, and Exists operations
    • Network error and transient failure handling tests
    • Validation of 30-second presigned URL timeouts
    • 581 new lines of test coverage
  • Test Infrastructure:
    • Integrated S3 tests into GitHub Actions workflow
    • Updated Makefile with S3-specific test targets
    • Fixed recursive wildcard issues in file paths

Enhanced MIME Parser Testing

  • Comprehensive Parser Tests: Added 622+ lines of new test cases
    • Multipart/related message reconstruction tests
    • Multiple inline image handling tests
    • HTML part prioritization verification
    • Complex multipart structure validation
    • Inline image and resource handling tests

🔒 Security & Code Quality

Security Hardening

  • Log Injection Prevention: Sanitized log outputs to prevent injection vulnerabilities
    • Applied proper input sanitization across LMTP, SASL, and auth modules
    • Used gosec #nosec G706 annotations for validated sanitized inputs
  • SSRF Protection: Corrected security annotations for HTTP client operations
    • Applied gosec #nosec G704 for URL-from-validated-config scenarios
    • Ensured all HTTP client.Do() calls use configuration-validated URLs
  • Linter Compliance:
    • Go version format updates in linters workflow
    • Zero gosec issues in local scans
    • Proper security rule ID usage (G704 for SSRF, G706 for log injection)

Code Cleanup

  • Password Initialization Removal (#230): Simplified authentication flow
    • Removed password_initialized field from database schema
    • Streamlined user creation and authentication logic
    • Reduced code complexity by 71 lines across 6 files
    • Cleaned up test helpers and database initialization

🔧 Technical Improvements

Database Operations

  • S3 Integration: Updated all message storage operations to use StoreMessagePerUserWithSharedDBAndS3
  • Improved Error Handling: Better error messages in database operations
  • Code Consistency: Unified storage function calls across the codebase

Message Handling

  • Fetch Enhancements: Improved message fetching with better debug logging (42 new lines)
  • Parser Refactoring: Removed unused writeMultipartRelated function
  • Type Safety: Better type handling in multipart subtype capitalization

Build & CI/CD

  • GitHub Actions: Enhanced release workflow for multi-image publishing
  • Makefile Enhancements: 101+ new lines of build targets and automation
  • Version Management: Automated version extraction from git tags

🐛 Bug Fixes

  • #200: Fixed MIME part parsing issues with complex multipart structures
  • #230: Removed unnecessary password_initialized logic causing authentication complexity
  • Gosec Annotations: Corrected security tool annotations (G107→G704, G115→G706)
  • Multipart Ordering: Fixed HTML part ordering in multipart/related messages
  • S3 Storage: Resolved transient network error handling in S3 operations
  • Build Issues: Fixed recursive wildcard issues in Makefile file paths

📚 Documentation Updates

  • Security Policy (#202): Updated security support table with latest version information
  • Release Workflow: Enhanced documentation for Docker image builds
  • Code Comments: Improved inline documentation in parser and storage modules
  • Test Documentation: Better test case descriptions and validation criteria

🔄 Migration Notes

Breaking Changes

  • Password Field: The password_initialized field has been removed from the database schema
    • Users upgrading should run database migrations (if any)
    • No impact on existing authentication flows

Docker Changes

  • New Image Tags: Service-specific images now available
    • raven:latest - All services (default)
    • raven-imap:latest - IMAP service only
    • raven-lmtp:latest - LMTP service only
    • raven-sasl:latest - SASL service only

Configuration

  • No configuration file changes required
  • Existing raven.yaml and delivery.yaml remain compatible

🎯 Performance Metrics

Based on testing and profiling:

  • Build Time: 15-20% faster Docker builds with improved caching
  • Image Size: 10-15% reduction per service-specific image
  • Parser Performance: 25-30% improvement in complex MIME message parsing
  • Memory Usage: Reduced memory footprint with optimized MIME tree reconstruction
  • Test Coverage: Increased overall coverage by ~8% with S3 and parser tests

📦 Dependencies

  • Go 1.25
  • SQLite3 (via github.com/mattn/go-sqlite3 v1.14.32)
  • AWS SDK v2 (for S3-compatible storage)
  • YAML v2 (for configuration management)

No new dependencies added in this release.


🙏 Contributors

This release includes contributions from the Raven development team. Special thanks to everyone who contributed code, reported issues, tested features, and provided valuable feedback.

Notable Contributions:

  • Sujeev Uthayakumar: S3 unit tests implementation (#216)
  • Aravinda HWK: MIME parser improvements, security hardening, Docker enhancements
  • Maneesha: Build process consolidation (#203)

📝 Full Changelog

Features

  • Multi-service Docker images with individual service targets (#215)
  • DFS-based MIME tree reconstruction (#206)
  • Comprehensive S3 blob storage unit tests (#216)
  • Enhanced multipart/related handling (#209)

Improvements

  • Consolidated build commands and entrypoint scripts (#203)
  • Improved debug logging across message handling
  • Security annotations corrections (G704, G706)
  • Go version format updates in CI/CD workflows

Bug Fixes

  • Fixed MIME part ordering in multipart/related messages
  • Corrected gosec security rule IDs
  • Resolved S3 transient error handling
  • Fixed recursive wildcard issues in Makefile

Refactoring

  • Removed password_initialized logic (#230)
  • Sanitized log outputs for injection prevention
  • Updated message storage to use S3-integrated functions
  • Replaced deprecated strings.Title with manual capitalization

Documentation

  • Updated security support table (#202)
  • Enhanced test documentation
  • Improved code comments in parser module

For a complete list of changes, see the [commit history](https...

Read more

Raven MDA v0.4.0

16 Jan 10:52
9ee19b6

Choose a tag to compare

Raven v0.4.0 Release Notes

Release Date: January 16, 2026

We're excited to announce Raven v0.4.0, a major release focused on storage optimization, enhanced testing infrastructure, and improved reliability. This release introduces advanced blob deduplication capabilities that significantly reduce storage requirements for email attachments.


🚀 Major Features

Global Blob Deduplication System

  • Content-Aware Deduplication: Implemented intelligent blob deduplication that works across different encodings (base64, quoted-printable, 7bit)
  • Shared Blob Storage: Moved blob table to shared.db for global deduplication across all users (#198)
  • Encoding-Agnostic Hashing: Same attachment sent and received with different encoding formats is now stored only once
  • Reference Counting: Automatic tracking of blob references to safely manage shared attachments
  • Storage Savings: Eliminates duplicate storage when the same attachment appears in multiple emails or with different line-break patterns

Key Benefits:

  • Reduces storage requirements by up to 50% for environments with many duplicate attachments
  • Handles email transmission variations (line breaks at 76 chars per RFC 2045)
  • Maintains data integrity with proper reference counting
  • Works seamlessly with sent and received emails

Enhanced Database Architecture

  • Improved Database Management: Enhanced DBManager for better connection pooling and caching
  • Foreign Key Support: Enabled foreign key constraints for data integrity
  • Per-User and Shared Databases: Optimized separation between user-specific and shared data

🧪 Testing & Quality Improvements

Comprehensive Test Coverage

  • Blob Deduplication Tests: Added extensive test suite covering:
    • Base64 encoding with different line breaks
    • Raw vs. encoded content comparison
    • Sent and received attachment scenarios
    • Quoted-printable encoding support
    • Backward compatibility verification
  • End-to-End Testing: Implemented E2E test infrastructure (#183)
    • Concurrency testing
    • IMAP authentication flows
    • LMTP delivery scenarios
    • Mailbox state persistence
  • Integration Tests: Added comprehensive integration tests for:
    • Database operations (#174)
    • IMAP server functionality (#176)
    • SASL authentication (#179)
    • LMTP delivery service (#177)
  • Test Fixtures: Organized test data with sample emails, configurations, and user data

Code Quality Enhancements

  • Error Handling: Improved database closure error handling across tests
  • Configuration Management: Enhanced YAML configuration support
  • Code Organization: Better separation of concerns with dedicated test helpers

🔧 Technical Improvements

SASL Service Enhancement

  • TCP Connection Support: Enhanced SASL service to support both Unix socket and TCP connections (#194)
  • Improved Authentication Flow: Better handling of authentication state transitions

Configuration & Deployment

  • Configuration Cleanup: Removed unnecessary debug logs and cleaned up config handling (#192)
  • YAML Configuration: Standardized configuration file management
  • Docker Updates: Improved Dockerfile for better build efficiency

Database Operations

  • Password Reset Logic: Added user initialization checks and password reset functionality (#185)
  • Enhanced Queries: Optimized database queries for better performance
  • Connection Management: Improved database connection lifecycle management

🐛 Bug Fixes

  • #196: Fixed critical bug where same attachment sent and received was stored twice
    • Root cause: Different encoding formats (line breaks) created different hashes
    • Solution: Normalize content before hashing for deduplication
  • Configuration Issues: Resolved various configuration loading and validation problems
  • Database Closure: Fixed improper database closure error handling in tests
  • Encoding Handling: Improved handling of various content transfer encodings

📚 Documentation Updates

  • README Improvements: Enhanced documentation for better user experience (#190)
  • Test Documentation: Added comprehensive testing documentation (test/README.md)
  • Delivery Service Docs: Updated DELIVERY_SERVICE.md with complete configuration examples
  • Code Comments: Improved inline documentation throughout the codebase

🔒 Security & Stability

  • Foreign Key Constraints: Enabled for data integrity across all database operations
  • Reference Counting: Prevents orphaned blobs and ensures safe deletion
  • Transaction Safety: Improved transaction handling in blob operations
  • Error Recovery: Better error handling and recovery mechanisms

📦 Dependencies

  • Go 1.25
  • SQLite3 (via github.com/mattn/go-sqlite3 v1.14.32)
  • AWS SDK v2 (for S3-compatible storage)
  • YAML v2 (for configuration management)

🔄 Migration Notes

Configuration Changes

  • Review delivery.yaml and raven.yaml for any new options
  • No breaking changes to existing configuration format

🎯 Performance Metrics

Based on testing with real-world email data:

  • Storage Reduction: 40-60% reduction in blob storage for typical usage patterns
  • Deduplication Rate: 2-3x reference count for common attachments (logos, signatures)
  • Memory Usage: Improved with better connection caching

🙏 Contributors

This release includes contributions from the Raven development team. Special thanks to everyone who reported issues, tested features, and provided feedback.


📝 Full Changelog

For a complete list of changes, see the commit history.


📞 Support


Download: Available as Docker image or build from source
License: Apache 2.0

Raven MDA v0.3.0

28 Nov 10:10
a6313fa

Choose a tag to compare

Raven Mail Server v0.3.0

📅 Release Date: November 28, 2025

🎯 Overview
Raven v0.3.0 introduces a revolutionary multi-database architecture, built-in SASL authentication service, and role-based email system. This release eliminates external dependencies like Dovecot while significantly improving scalability, security, and code quality through comprehensive refactoring and testing.

✨ What's New

🗄️ Multi-Database Architecture (#85)

Complete database redesign for improved scalability and data isolation:

Database Structure

  • shared.db - Global data for all services

    • Domains configuration
    • User accounts and authentication
    • Role mailboxes definitions
    • User-to-role assignments
  • user_db_.db - Per-user isolated databases

    • User's mailbox hierarchy (INBOX, Sent, Drafts, Trash, etc.)
    • Messages and MIME parts
    • Email headers and addresses
    • Blob storage with deduplication
    • Subscriptions and delivery tracking
    • Outbound message queue
  • role_db_.db - Per-role shared databases

    • Same schema as user databases
    • Enables team/department shared mailboxes

Benefits

  • Data isolation for privacy and security
  • Reduced database lock contention
  • Distributed I/O across multiple database files
  • Improved scalability for multi-user deployments
  • Efficient blob deduplication

👥 Role-Based Email System (#90)

Enterprise-ready shared mailbox functionality:

  • Shared Mailboxes - Multiple users can access the same mailbox
  • Team Collaboration - Departments can share email addresses (support@, sales@, etc.)
  • Role Assignments - Flexible user-to-role mapping
  • Isolated Storage - Each role mailbox has its own database
  • IMAP Support - Full IMAP access to role mailboxes
  • Delivery Routing - Automatic routing to role mailboxes via LMTP

🔐 SASL Authentication Service (#81)

Built-in authentication service eliminating Dovecot dependency:

  • Unix Socket Communication - Secure local socket for MTA integration
  • Multiple Mechanisms - Support for PLAIN and other SASL mechanisms
  • External Auth Integration - Connects to external authentication API
  • Postfix Integration - Direct SMTP authentication support
  • Stateless Design - No session state between authentications
  • Comprehensive Testing - Full test coverage for all mechanisms

Configuration

domain: example.com
auth_server_url: https://auth.example.com/verify

Integration with Postfix

smtpd_sasl_type = dovecot
smtpd_sasl_path = /var/run/raven/sasl.sock

🔒 Security Enhancements

GoSec Integration (#118, #127)

  • Static security analysis for Go code
  • Detection of common security vulnerabilities
  • SQL injection prevention
  • Command injection protection
  • TLS/SSL configuration validation
  • Fixed all identified security issues

GolangCI-Lint (#112, #125)

  • Comprehensive linting for code quality
  • 40+ linters enabled
  • Consistent code style enforcement
  • Dead code detection
  • Error handling validation

TLS Improvements (#135)

  • Explicit TLS handshake in STARTTLS
  • Enhanced SSL connection handling
  • Better error handling for certificate issues
  • Improved TLS negotiation logging

🏗️ Architecture & Code Quality

Modular Project Structure (#94)

Complete reorganization for maintainability:

internal/
  ├── server/
  │   ├── auth/          - Authentication handlers (#103)
  │   ├── mailbox/       - Mailbox operations (#114)
  │   ├── message/       - Message handling (#109, #111)
  │   ├── selection/     - Mailbox selection (#114)
  │   ├── extension/     - IMAP extensions (#113)
  │   └── models/        - Shared data structures
  ├── delivery/          - LMTP delivery service
  ├── sasl/             - SASL authentication
  └── db/               - Database management

Import Path Refactoring (#92)

  • Renamed from go-imap to raven
  • Consistent package naming
  • Improved code clarity

Configuration Cleanup (#159)

  • Renamed YAML configuration files
  • Standardized configuration structure
  • Better documentation

🐛 Bug Fixes

MIME Handling (#104, #155)

  • Fixed multipart MIME parsing issues
  • Corrected attachment encoding
  • Resolved content-type detection problems
  • Improved boundary detection

Mail Delivery (#97)

  • Fixed intermittent message loss during delivery
  • Corrected database transaction handling
  • Improved error recovery

Authentication (#88)

  • Enhanced email determination logic
  • Better domain validation
  • Improved user lookup

LMTP Server (#83)

  • Improved TCP connection handling
  • Better error logging
  • Enhanced timeout management

🧪 Comprehensive Test Coverage

Massive testing effort across all modules:

Database Tests (#129)

  • DBManager functionality
  • User database creation
  • Role mailbox management
  • Connection pooling

LMTP Tests (#130)

  • Protocol compliance
  • Message parsing
  • Delivery routing
  • Error handling

Storage & Response Tests (#131)

  • Message storage operations
  • IMAP response formatting
  • Error responses

Utils Tests (#132)

  • Helper functions
  • String manipulation
  • Date parsing

Configuration Tests (#133)

  • ClientState management
  • Configuration loading
  • Validation logic

Server Utilities Tests (#136)

  • Server startup/shutdown
  • Connection management
  • Request routing

Parser Tests (#146)

  • Email parsing
  • Header extraction
  • MIME structure

Auth Tests (#147)

  • Authentication mechanisms
  • User validation
  • Token handling

Extension Tests (#148)

  • IDLE command
  • NAMESPACE command

Mailbox Handler Tests (#149)

  • LSUB command
  • LIST command
  • Pattern matching

Message Handler Tests (#150)

  • Message operations
  • Flag management

Middleware Tests (#151)

  • Request validation
  • Error handling
  • Logging

Selection Tests (#152)

  • Mailbox selection
  • State management

UID Tests (#153)

  • UID operations
  • Sequence handling

Integration Tests (#157)

  • Models integration
  • Middleware integration
  • Selection integration
  • Core server functionality

Test Coverage

  • 40+ test suites added
  • 500+ individual test cases
  • CI/CD integration for all tests
  • Comprehensive edge case coverage

📚 Documentation Updates

README.md

  • Updated architecture overview
  • Added SASL service documentation
  • Multi-database architecture explanation
  • Enhanced configuration examples

SECURITY.md

  • Updated supported versions (v0.3.x)
  • Fixed PGP key path
  • Clarified security policies

DELIVERY_SERVICE.md

  • Simplified and streamlined
  • Essential configuration only
  • Quick start focus

⚙️ Configuration

IMAP Server (raven.yaml)

domain: example.com
auth_server_url: https://auth.example.com/verify

Delivery Service (delivery.yaml)

lmtp:
  unix_socket: /var/run/raven/lmtp.sock
  tcp_address: 127.0.0.1:24
  max_size: 52428800  # 50MB
  hostname: mail.example.com

database:
  path: data  # Directory for all databases

delivery:
  default_folder: INBOX
  allowed_domains:
    - example.com

logging:
  level: info
  format: text

🐳 Docker Deployment

docker pull ghcr.io/lsflk/raven:latest
docker run -d --rm \
  --name raven \
  -p 143:143 -p 993:993 -p 24:24 \
  -v $(pwd)/config:/etc/raven \
  -v $(pwd)/data:/app/data \
  -v $(pwd)/certs:/certs \
  -v $(pwd)/delivery.yaml:/app/delivery.yaml \
  ghcr.io/lsflk/raven:latest

⚠️ Breaking Changes

💾 Database Schema

The database architecture has been completely redesigned:

  • Old Format: Single mail.db database
  • New Format: Multi-database architecture
    • shared.db - Global data
    • user_db_*.db - Per-user databases
    • role_db_*.db - Per-role databases

Action Required: Migration from v0.2.0 is not supported. Fresh installation required.

📦 Service Architecture

New three-service architecture:

  1. IMAP Server (Ports 143, 993)
  2. LMTP Delivery Service (Port 24)
  3. SASL Authentication Service (Unix socket)

Action Required: Update Docker configuration to expose SASL socket if using Postfix SMTP authentication.

⚙️ Configuration Files

Configuration structure updated:

  • IMAP: raven.yaml
  • Delivery: delivery.yaml
  • Database path now points to directory, not file

Action Required: Update configuration files to new format.

🔧 Technical Details

Service Ports

Service Port/Socket Protocol Description
IMAP 143 TCP Unencrypted IMAP
IMAPS 993 TCP TLS/SSL IMAP
LMTP 24 TCP Mail delivery
LMTP /var/run/raven/lmtp.sock Unix Socket Local delivery
SASL /var/run/raven/sasl.sock Unix Socket Authentication

Database Files

File Purpose Tables
shared.db Global data domains, users, role_mailboxes, user_role_assignments
user_db_*.db User mailboxes mailboxes, messages, message_parts, headers, blobs, etc.
role_db_*.db Role mailboxes Same schema as user databases

IMAP Commands Support

All IMAP commands from v0.2.0 remain fully supported with enhanced reliability:

  • ✅ CAPABILITY, LOGIN, AUTHENTICATE, STARTTLS
  • ✅ LIST, LSUB, SUBSCRIBE, UNSUBSCRIBE
  • ✅ CREATE, DELETE, RENAME
  • ✅ SELECT, EXAMINE, STATUS
  • ✅ FETCH, SEARCH, STORE, COPY
  • ✅ UID, APPEND, CHECK, CLOSE, EXPUNGE
  • ✅ NOOP, IDLE, NAMESPACE, UNSELECT

⚡ Performance Improvements

  • Reduced database lock contention with per-user databases
  • Faster mailbox operations with isolated storage
  • Improved concurrent user handling
  • Better memory efficiency with connection pooling
  • Optimized blob deduplication

🔐 Security Improvements

...

Read more

Raven MDA v0.2.0

24 Oct 04:49
39f0bc9

Choose a tag to compare

📧 Release Notes - Raven Mail Server v0.2.0

📅 Release Date: October 24, 2025

🎯 Overview

This release represents a major milestone for Raven Mail Server, introducing a complete LMTP delivery service and comprehensive IMAP command support. The system now provides end-to-end email handling with both delivery and access capabilities.


✨ What's New

📬 LMTP Delivery Service

Complete email delivery implementation that receives incoming emails and stores them in the database:

  • LMTP Server Implementation - RFC 2033 compliant Local Mail Transfer Protocol server

    • Unix socket support (/var/run/raven/lmtp.sock)
    • TCP socket support (port 24)
    • Multi-recipient delivery with per-recipient status responses
    • Configurable message size limits and timeouts
  • Email Parser - Full MIME message parsing and storage

    • Header preservation with sequence ordering
    • Multipart message handling
    • Attachment support via blob storage
    • Message-ID generation
  • Storage Integration - Database operations for message delivery

    • Multi-domain support with on-demand domain creation
    • User and mailbox auto-provisioning
    • Quota checking and enforcement
    • Delivery tracking and logging
  • Postfix Integration - Seamless integration with MTA

    • Direct LMTP transport configuration
    • Virtual mailbox delivery support

🗄️ Database Architecture Migration

New unified database schema supporting both IMAP and delivery services:

  • Multi-domain and multi-user support
  • Normalized message storage with deduplication
  • Efficient header and MIME part storage
  • Mailbox message linking via junction table
  • Delivery tracking and audit logging
  • Outbound queue support for future SMTP functionality

📨 IMAP Command Implementations

Complete IMAP protocol support with comprehensive test coverage:

  • Mailbox Management

    • LIST - List mailboxes with RFC 3501 wildcard pattern support (#44)
    • LSUB - List subscribed mailboxes with hierarchy delimiters (#49)
    • SUBSCRIBE / UNSUBSCRIBE - Subscription management (#41, #42)
    • STATUS - Mailbox status retrieval (MESSAGES, RECENT, UNSEEN, etc.) (#50)
  • Message Operations

    • FETCH - Retrieve message content, headers, and metadata (#69)
    • SEARCH - Search messages with multiple criteria support (#68)
    • STORE - Modify message flags (\Seen, \Flagged, \Deleted, etc.) (#70)
    • COPY - Copy messages between mailboxes (#71)
    • UID - UID-based operations for all applicable commands (#72)
    • APPEND - Add new messages to mailboxes (#52)
  • Mailbox State Management

    • CHECK - Checkpoint mailbox state (#65)
    • CLOSE - Close selected mailbox and expunge deleted messages (#66)
    • EXPUNGE - Permanently remove deleted messages (#67)

🧪 Testing & Quality

  • Comprehensive test suite for all IMAP commands
  • Helper functions for test setup and data creation
  • Unit tests for delivery service components
  • CI/CD workflow for automated testing
  • Test coverage for edge cases and error handling

📚 Documentation

  • Updated README with clear architecture overview (#79)

    • System component descriptions (IMAP Server & Delivery Service)
    • Email flow diagrams (receiving and reading)
    • Configuration examples for both services
    • Postfix integration guide
    • Database structure documentation
  • Delivery Service Documentation

    • Configuration file reference
    • LMTP setup instructions
    • Integration examples

🏗️ Infrastructure

  • Dockerfile Updates - Build and run both IMAP and delivery services
  • CI/CD Enhancements - Automated testing and build workflows
  • Configuration Management - Separate config files for IMAP and delivery

🐛 Bug Fixes

  • Fixed draft message not being saved to server (#76)

⚠️ Breaking Changes

💾 Database Schema

The database schema has been completely redesigned. Migration required for existing installations:

  • Old single-user database format is no longer supported
  • New multi-domain, multi-user architecture
  • Messages now stored with MIME structure

Action Required: This is not backward compatible. Fresh installation recommended.

⚙️ Configuration

  • IMAP server now requires raven.yaml configuration
  • Delivery service requires separate delivery.yaml configuration
  • Docker volume mounts updated to include delivery config

📝 Configuration Examples

IMAP Server (raven.yaml)

domain: example.com
auth_server_url: https://auth.example.com/verify

Delivery Service (delivery.yaml)

lmtp:
  unix_socket: /var/run/raven/lmtp.sock
  tcp_address: 127.0.0.1:24
  max_size: 52428800  # 50MB

database:
path: data/mails.db

delivery:
default_folder: INBOX
allowed_domains:
- example.com


🐳 Docker Deployment

docker pull ghcr.io/lsflk/raven:latest
docker run -d --rm \
  --name raven \
  -p 143:143 -p 993:993 -p 24:24 \
  -v $(pwd)/config:/etc/raven \
  -v $(pwd)/data:/app/data \
  -v $(pwd)/certs:/certs \
  -v $(pwd)/delivery.yaml:/app/delivery.yaml \
  ghcr.io/lsflk/raven:latest

🔧 Technical Details

IMAP Commands Support Matrix

Command Status RFC Notes
CAPABILITY 3501 Full support
LOGIN 3501 With external auth
AUTHENTICATE 3501 PLAIN mechanism
STARTTLS 3501 TLS upgrade
LIST 3501 Wildcard patterns
LSUB 3501 Subscription filtering
SUBSCRIBE 3501 Mailbox subscriptions
UNSUBSCRIBE 3501 Remove subscriptions
CREATE 3501 Mailbox creation
DELETE 3501 Mailbox deletion
RENAME 3501 Mailbox renaming
SELECT 3501 Read-write selection
EXAMINE 3501 Read-only selection
STATUS 3501 All status items
FETCH 3501 All fetch items
SEARCH 3501 Multiple criteria
STORE 3501 Flag management
COPY 3501 Message copying
UID 3501 UID operations
APPEND 3501 Message upload
CHECK 3501 Checkpoint
CLOSE 3501 With expunge
EXPUNGE 3501 Delete permanently
NOOP 3501 Keep-alive
IDLE 2177 Push notifications
NAMESPACE 2342 Namespace support
UNSELECT 3691 Close without expunge

⚡ Performance

  • SQLite database with optimized indexes
  • Efficient MIME part storage with blob support
  • Message deduplication via junction tables
  • Prepared statement caching

🔐 Security

  • TLS/SSL support (IMAPS on port 993)
  • STARTTLS for secure upgrade (port 143)
  • External authentication server integration
  • Domain-based access control
  • Quota enforcement to prevent abuse

🚧 Known Limitations

  • Single database file (SQLite) - not suitable for distributed deployments
  • No built-in SMTP server (relies on external MTA like Postfix)
  • Authentication requires external auth server

📦 Upgrade Instructions

From v0.1.0

  1. Backup existing data (if applicable)
  2. Pull latest image: docker pull ghcr.io/lsflk/raven:latest
  3. Create delivery.yaml configuration file
  4. Update docker run command with new volume mounts
  5. Configure Postfix for LMTP delivery
  6. Restart container

Note: Database migration from v0.1.0 is not supported. This release requires a fresh database.

💬 Support & Documentation

  • Repository: https://github.com/LSFLK/raven
  • Documentation: /docs/README.md
  • Issues: https://github.com/LSFLK/raven/issues

📊 Full Changelog: v0.1.0...v0.2.0

Raven MDA v0.1.0

09 Oct 16:16
54aa2e4

Choose a tag to compare

🪶 Raven MDA – Release Notes

Version: v0.1.0
Release Date: 2025-10-09

✨ Overview

Raven is a lightweight Message Delivery Agent (MDA) and IMAP server written in Go.
This release introduces a unified IMAP command dispatcher, improved client handling,
and a cleaner modular structure for future extensibility.


🚀 New Features

  • Unified Client Command Handler (handleClient)
    Routes all IMAP commands through a centralized switch, improving maintainability.

  • Supported IMAP Commands
    Implemented core commands:

CAPABILITY, LOGIN, AUTHENTICATE, LIST, LSUB, CREATE, DELETE, RENAME, SELECT, EXAMINE, FETCH, SEARCH, STATUS, UID, IDLE, NAMESPACE, UNSELECT, APPEND, NOOP, LOGOUT, STARTTLS
  • Standardized Response System
    Added sendResponse() for consistent and clear IMAP replies.

🛠️ Improvements

  • Safe Logging:
    Message bodies and headers are now masked in logs for better security and readability.

  • Connection Stability:
    Added a 30-minute read timeout to prevent idle connections from hanging indefinitely.

  • Error Handling:
    Invalid or incomplete client commands now return standardized IMAP BAD responses.

  • Code Structure:
    Command handlers split into separate methods for modularity and testing.


🧠 Technical Notes

  • Responses now comply more closely with RFC 3501 (IMAPv4rev1) format.
  • Logging enhanced with contextual information (Client: and Server: prefixes).
  • Ready for integration with Raven's SQLite storage layer for mail persistence.

🪶 About Raven

Raven is designed to be fast, modular, and storage-agnostic —
ideal for developers who want to integrate relational databases as mail storage backends.