Skip to the content.

GoSMTP-dup

An SMTP relay server that duplicates incoming emails to multiple destinations for smooth mail server migration.

Overview

GoSMTP-dup acts as an SMTP proxy that receives emails and forwards them to multiple destinations:

The main purpose is to enable smooth migration from one mail server to another by duplicating traffic in real-time.

Architecture

graph TD
    A[Email Client] -->|SMTP| B[Postfix Server]
    B -->|Transport Map| C[GoSMTP-dup :2525]

    C -->|Synchronous| D[Primary Mail Server]
    C -->|Asynchronous| E[Backup Mail Server 1]
    C -->|Asynchronous| F[Backup Mail Server 2]

    D -->|Success/Failure| C
    E -.->|Background| C
    F -.->|Background| C

    C -->|Response| B
    B -->|Response| A

    style C fill:#e1f5fe
    style D fill:#c8e6c9
    style E fill:#fff3e0
    style F fill:#fff3e0
    style B fill:#f3e5f5

    classDef primary stroke:#4caf50,stroke-width:3px
    classDef backup stroke:#ff9800,stroke-width:2px,stroke-dasharray: 5 5
    classDef proxy stroke:#2196f3,stroke-width:3px

    class D primary
    class E,F backup
    class C proxy

Flow Explanation:

  1. Email clients send emails to Postfix
  2. Postfix routes specific domains through the duplicator via transport maps
  3. GoSMTP-dup receives the email and:
    • Sends to primary server synchronously (must succeed)
    • Sends to backup servers asynchronously (failures logged but ignored)
  4. Response is based only on primary server success/failure

Quick Start

Using Docker

# Pull the latest image
docker pull ghcr.io/cabonemailserver/gosmtp-dup:latest

# Run with environment variables
docker run -d \
  --name smtp-duplicator \
  -p 2525:2525 \
  -e SMTP_DUP_SMTP_LISTEN="0.0.0.0:2525" \
  -e SMTP_DUP_RELAY_DESTINATION_PRIMARY="mailprimary.example.com:25" \
  -e SMTP_DUP_RELAY_DESTINATION_BACKUPS="backup1.example.com:25,backup2.example.com:25" \
  ghcr.io/cabonemailserver/gosmtp-dup:latest

Using Binary

Download the latest binary from GitHub Releases:

# Linux
wget https://github.com/CaboneMailServer/GoSMTP-dup/releases/latest/download/gosmtp-dup-linux-amd64
chmod +x gosmtp-dup-linux-amd64
./gosmtp-dup-linux-amd64

Features

Use Cases

Documentation Index

📥 Installation Guide

⚙️ Configuration Reference

🌍 Environment Variables

🐳 Docker Usage

📧 Postfix Integration

📄 License

Download

Platform Download
Linux AMD64 Download
Linux ARM64 Download
Windows AMD64 Download
macOS AMD64 Download
macOS ARM64 Download

Docker Images

License

Licensed under the MIT License - see the LICENSE.md file for full details.

Contributing

Contributions are welcome! Please see the GitHub repository for issues and pull requests.