Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mail Relay Deployment

Deploys a lightweight Postfix mail relay based on mwader/postfix-relay. It accepts unauthenticated local emails on port 25, rewrites all sender addresses to a defined address, and securely relays the emails to an upstream SMTP provider.

Features

  • Accepts unqualified senders and all recipients from internal networks.
  • Accepts SMTP requests without TLS and authentication.
  • Optionally accepts inbound TLS requests (generates a self-signed certificate on startup).
  • Relays outbound emails via authenticated SMTP over TLS.
  • Rewrites envelope senders and From: headers dynamically based on .env configuration.

Prerequisites

  • A working Docker host.
  • Port 25 must be available. On Debian hosts, disable the default MTA:
    sudo systemctl stop exim4
    sudo systemctl disable exim4

Deployment

  1. Prepare the deployment directory:
    sudo mkdir -p /opt/mailrelay
    sudo chown $USER:$USER /opt/mailrelay
    cd /opt/mailrelay
    
    git clone git@github.com:sdrwtf-labs/mailrelay-deployment.git .
  2. Make the wrapper script executable:
    chmod +x wrapper.sh
  3. Configure the environment variables:
    cp .env.example .env
    nano .env
  4. Start the service:
    docker compose up -d

Continuous Deployment

This repository is configured for automated deployments via GitHub Actions. Pushes to the main branch will trigger an SSH action to pull the latest code and recreate the container. Ensure the SSH_PRIVATE_KEY secret is configured in the repository settings.

About

Postfix mailrelay setup

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages