Skip to content

Releases: marksxiety/email-queue-service

v1.3.1

15 Feb 13:42

Choose a tag to compare

Security Hardening for File Attachments

This release addresses critical security vulnerabilities in file attachment handling and introduces comprehensive security measures to protect against path traversal attacks, file type spoofing, and denial-of-service attempts.

Key Security Fixes

  • Path Traversal Protection: Filenames are now sanitized to prevent directory traversal attacks (e.g., ../../../etc/passwd)
  • Magic Byte Verification: File types are detected using actual content rather than trusting client-provided MIME headers
  • Extension Whitelist: Only allowed file extensions (.pdf, .doc, .docx, .xls, .xlsx, .txt, .zip, .jpg, .jpeg, .png, .gif, .bmp, .webp, .tiff) are accepted
  • File Size Limits: Maximum file size enforcement (default 10MB) to prevent DoS attacks
  • Null Filename Validation: Proper handling of missing attachment filenames

What's New

  • Added sanitize_filename() function for filename security
  • Implemented magic byte verification using python-magic
  • Configurable MAX_FILE_SIZE environment variable
  • Enhanced ALLOWED_EXTENSIONS and ALLOWED_MIME_TYPES configuration

Documentation

  • Created SETUP.md with installation instructions
  • Restructured README.md for better organization
  • Added file attachment security documentation

v1.3.0

08 Feb 04:43

Choose a tag to compare

Improve Reliability with Rate Limiting and Email Validation

This release strengthens system reliability by implementing comprehensive API rate limiting and introducing email type validation. Rate limiting helps prevent service overload and ensures stable performance, while email type validation ensures that only registered email types are processed, reducing errors from invalid inputs. A retry mechanism for worker failures has also been added to further improve robustness.

v1.2.1

13 Jan 02:29

Choose a tag to compare

Add Comprehensive Test Suite and CI/CD Pipeline

Overview

This release establishes a robust testing foundation and automated CI/CD pipeline, significantly improving code quality, reliability, and maintainability of the Email Queue Service.


Test Suite

A comprehensive test suite has been added covering critical functionality:

Core Services

  • publish_to_rabbitmq - Multiple priority levels and message scenarios
  • get_file_attachments - Edge cases and validation scenarios
  • calculate_sha256 - Hash generation and verification
  • render_email_template - Template rendering with dynamic data
  • parse_address_value - Input parsing with diverse formats

Database Operations

  • Email queue transaction tests
  • Connection testing with error handling

Utilities

  • print_logging and get_logger - Unit and integration tests
  • Centralized pytest configuration via conftest.py

CI/CD Pipeline

GitHub Actions Workflow

  • Automated test execution on every commit
  • Coverage reporting and tracking
  • Build status visibility via badges

Documentation Updates

Testing Resources

  • Dedicated requirements file for testing dependencies
  • Unit testing instructions and best practices
  • Coverage reporting guidelines

README Improvements

  • Added CI/CD status badge
  • Reordered badges for better visibility
  • Updated documentation links

Maintenance

  • Removed unused modules and folders
  • Cleaned up deprecated code

Impact

Code Quality

  • 9 new test files/functions ensuring core functionality works as expected
  • Automated testing catches issues before production

Developer Experience

  • Clear testing guidelines for contributors
  • Faster feedback loop with CI/CD automation

Reliability

  • Critical paths now covered by automated tests
  • Improved confidence in code changes

v1.2.0

11 Jan 13:34

Choose a tag to compare

Release v1.2.0

Features

Dynamic Recipients Override

  • Added optional to_address, cc_addresses, and bcc_addresses fields to allow microservices to override default recipients from email_types table per request

Flexible Recipient Merging

  • When dynamic recipients are provided, they override the default values; otherwise, defaults from email_types table are used

Array Support in Form-Data

  • Support for sending multiple recipients by repeating field names in multipart/form-data requests

File Attachment Handling

  • Enhanced file attachment processing with better file path management

Refactoring

Modularization

Extracted utility functions into separate modules for better code organization:

  • attachment_processor.py - Attachment processing logic
  • rabbitmq_publisher.py - RabbitMQ publishing
  • email_utils.py - Email utilities
  • template_utils.py - Template handling
  • worker_utils.py - Worker utilities
  • file_utils.py - File operations
  • email_parser.py - Email parsing
  • attachment_utils.py - Attachment utilities

Documentation

Restructured Documentation

  • Separated project overview (README.md) from usage instructions (USAGE.md)

Updated Usage Guide

  • Added detailed examples for dynamic recipients and attachments with Postman-style request formats

New Database Documentation

  • Added DATABASE.md - Dedicated documentation for database schema and operations

Dependencies

  • Updated requirements.txt - Listed all dependencies with versions

Changes

File Description
app/api_server.py Added optional recipient parameters
app/database/transactions.py Updated recipient merging logic
app/worker.py Enhanced file attachment handling
requirements.txt Updated library versions
README.md Simplified to overview and architecture
USAGE.md New file with detailed usage examples

v.1.1.0

09 Jan 09:48

Choose a tag to compare

Release v1.1.0

Summary

This release focuses on significant internal refactoring and introduces full file attachment support for queued emails, improving maintainability, scalability, and email handling.


What’s Changed

Major Refactoring

  • Modularized the codebase by extracting utility logic into dedicated modules
  • Introduced separate utility files for:
    • Attachment processing
    • Email parsing
    • File operations
    • RabbitMQ publishing
    • Template handling
    • Worker operations
  • Simplified core entry points:
    • Reduced complexity in api_server.py and worker.py
    • Moved 311 lines of code into 8 new utility modules for better maintainability and clarity

New Features

  • File Attachment Support
    • Added functionality to retrieve attachment metadata using email ID from the database
    • Enhanced worker processing to include attachments for queued emails
    • Improved file upload handling with safer and cleaner filename management

Enhancements

  • Improved filename handling:
    • Removed UUID-based naming for better readability
    • Implemented counter-based naming to prevent duplicate filename conflicts
  • Updated project dependencies to their latest compatible versions

Files Modified

  • app/api_server.py – Refactored and improved file handling
  • app/worker.py – Refactored with added attachment support
  • app/database/transactions.py – Added attachment-related queries
  • app/utils/ – New directory containing 8 utility modules
  • requirements.txt – Updated dependencies

v1.0.0

08 Jan 07:16

Choose a tag to compare

Email Queue Service - v1.0.0

Introducing the first stable release of Email Queue Service – a centralized email delivery microservice designed to decouple email sending from automation systems. This production-ready service provides reliable, scalable email processing through a clean API with priority-based queuing.

Key Features

  • FastAPI REST API – Simple POST /api/v1/emails/queue endpoint accepting multipart/form-data requests
  • Priority-Based Queuing – Three-tier priority system (high/normal/low) with RabbitMQ for reliable message delivery
  • Email Templates – Jinja2-powered template rendering with dynamic content injection
  • File Attachments – Support for multiple attachments with SHA256 checksum verification and MIME type validation
  • Status Tracking – Full lifecycle tracking (pending/sent/failed) with PostgreSQL persistence
  • Worker Process – Background consumer that processes queues in priority order
  • SMTP Delivery – Secure email delivery via SMTP with SSL/TLS support
  • Configuration Management – Environment-based configuration for easy deployment
  • Email Types System – Pre-configured recipient addresses per email type
  • Resilient Architecture – Database connection pooling and error handling

Architecture

  • Client
    • Sends requests to → FastAPI
      • Stores queued emails in → PostgreSQL (Email Queue)
      • Publishes to → RabbitMQ (Priority Queues)
        • Consumed by → Worker (Templates + Attachments)
          • Sends via → SMTP
            • Delivered to → Recipient

Tech Stack

  • Framework: FastAPI with Uvicorn
  • Queue: RabbitMQ 3.8+
  • Database: PostgreSQL with psycopg2-binary
  • Template Engine: Jinja2
  • Email Protocol: SMTP with SSL/TLS
  • Python Version: 3.8+