Skip to content
Containerized Infrastructure & DevOpsRFC 5321 + RFC 3207Port 587 STARTTLS

Docker Compose Outbound SMTP Relay: Zero-MTA Email Dispatch

Dispatch transactional emails from containerized microservices without running heavy Postfix containers or opening blocked port 25. Authenticated port 587 TLS with automatic Dual-DKIM signing.

587Outbound Submission Port
0 MBHost Postfix MTA Bloat
< 150msQueue Dispatch Latency
Dual-DKIMEd25519 + RSA-2048
Production Specification

Docker Compose Configuration

docker-compose.yml· ESMTP Submission Service
YAML
version: '3.8'

services:
  web-app:
    image: your-app-image:latest
    restart: unless-stopped
    ports:
      - "3000:3000"
    environment:
      # SadaSend ESMTP Submission Relay (RFC 5321 / RFC 3207)
      - SMTP_HOST=smtp.sadasend.com
      - SMTP_PORT=587
      - SMTP_SECURE=false # STARTTLS upgrades to TLS 1.3
      - SMTP_USER=sadasend
      - SMTP_PASS=${SADASEND_API_KEY}
      - EMAIL_FROM=alerts@yourdomain.com
    env_file:
      - .env.production
Implementation Walkthrough

Configure Containerized Mail in 4 Steps

Step 01

Generate Token-Scoped API Key

In your SadaSend Dashboard (/app/keys), mint a dedicated API key restricted to outbound email dispatch for your production containers.

Step 02

Define Secure Environment Secrets

Store your credentials in .env.production and add it to your .gitignore to prevent leaking API keys into public git repositories.

BASH
SADASEND_API_KEY=sk_live_981a7b2c01ef4388
SMTP_HOST=smtp.sadasend.com
SMTP_PORT=587
SMTP_USER=sadasend
Step 03

Inject Variables into docker-compose.yml

Reference the environment variables in your service definitions. Your containerized application connects directly over port 587.

Step 04

Deploy Containers and Verify Transport

Spin up your compose stack with docker compose up -d. SadaSend automatically applies Dual-DKIM signatures to all outbound MIME envelopes.

Application Runtimes

Dispatch Code Recipes for Microservices

Clean, zero-bloat implementations using native language libraries inside your containers.

mailer.ts· Standard Nodemailer transport configured from Docker environment variables.
TYPESCRIPT
import nodemailer from 'nodemailer';

export const transporter = nodemailer.createTransport({
  host: process.env.SMTP_HOST || 'smtp.sadasend.com',
  port: Number(process.env.SMTP_PORT) || 587,
  secure: false, // true for 465, false for 587 (STARTTLS)
  auth: {
    user: process.env.SMTP_USER || 'sadasend',
    pass: process.env.SADASEND_API_KEY,
  },
});

export async function sendAlert(to: string, subject: string, html: string) {
  return transporter.sendMail({
    from: process.env.EMAIL_FROM || 'alerts@yourdomain.com',
    to,
    subject,
    html,
  });
}
Architectural Comparison

SadaSend ESMTP Relay vs. Self-Hosted Postfix Containers

Relay ApproachSetup ComplexityPort 25 VPS BlockDKIM MaintenanceOverage Cost Risk
SadaSend ESMTP Relay
1 minute (Env vars only)Unaffected (Port 587 TLS)Automated Dual-DKIM$0 default ceiling
Self-Hosted Postfix Container
Complex (MTA configs, SASL, ports)Blocked on 95% of Cloud VPSManual OpenDKIM keys & cronInfinite retry loops
SendGrid SMTP Integration
Moderate (Account verification)Port 587 supportedSingle RSA 2048 onlyUnmetered overages billed
AWS SES SMTP Interface
High (IAM, VPC NAT gateways)Port 587 supportedEasy DKIM (RSA)Auto-billed per message
Technical FAQs

Frequently Asked Questions

Clean Outbound Email for Docker Compose

Stop struggling with blocked port 25 and fragile Postfix containers. Connect over port 587 with automatic Dual-DKIM signing and zero credit card required.