Adding the configuration change for multiple provider, Making the service run in foreground and adding test

This commit is contained in:
Ketan Patel committed 2025-10-30 16:58:53 -04:00
1 parent 85ab503afb
commit 4eaa4d91ea
10 files changed
+1639 -140

No files matched your search

+109 -6
View File
@@ -1,8 +1,111 @@
# ============================================
# Postfix SMTP Relay - Environment Variables
# ============================================
# Copy this file to .env and configure your settings
# Supports: Maileroo, Mailtrap, SendGrid, and generic SMTP servers
# ============================================
# General Configuration
# ============================================
# Timezone (default: America/New_York)
TIMEZONE='America/New_York'
SMTP_SERVER='smtp.example.com'
SERVER_HOSTNAME=server_name
# Domain for outgoing mail
DOMAIN=example.com
# Server hostname (optional - defaults to container hostname)
SERVER_HOSTNAME=mail.example.com
# Port to expose on host (default: 25)
SMTP_LISTEN_PORT=25
# Data folder for logs, mail, and spool (default: current directory)
DATA_FOLDER=./data
# Optional: Custom networks to allow relay (comma-separated CIDR notation)
# SMTP_NETWORKS=192.168.1.0/24,10.0.0.0/8
# Optional: Add custom header tag to relayed messages
# SMTP_HEADER_TAG=MyRelay
# Debug mode (yes/no) - enables verbose logging
DEBUG=no
# ============================================
# SMTP Provider Configuration
# Choose ONE of the following configurations
# ============================================
# --------------------------------------------
# Option 1: Maileroo (Current Configuration)
# --------------------------------------------
SMTP_SERVER='smtp.maileroo.com'
SMTP_PORT=587
DOMAIN=smtp_domain
SMTP_USERNAME=apikey
SMTP_PASSWORD='api_key'
DATA_FOLDER='Local data folder'
SMTP_USERNAME=noreply@example.com
SMTP_PASSWORD=your_maileroo_password_here
# --------------------------------------------
# Option 2: Mailtrap
# --------------------------------------------
# SMTP_SERVER='live.smtp.mailtrap.io'
# SMTP_PORT=587
# SMTP_USERNAME=your_mailtrap_username
# SMTP_PASSWORD=your_mailtrap_password
# For Mailtrap Sandbox (testing):
# SMTP_SERVER='sandbox.smtp.mailtrap.io'
# SMTP_PORT=2525
# SMTP_USERNAME=your_mailtrap_sandbox_username
# SMTP_PASSWORD=your_mailtrap_sandbox_password
# --------------------------------------------
# Option 3: SendGrid
# --------------------------------------------
# SMTP_SERVER='smtp.sendgrid.net'
# SMTP_PORT=587
# SMTP_USERNAME=apikey
# SMTP_PASSWORD=your_sendgrid_api_key_here
# --------------------------------------------
# Option 4: Generic SMTP Server
# --------------------------------------------
# SMTP_SERVER='smtp.example.com'
# SMTP_PORT=587
# SMTP_USERNAME=your_username
# SMTP_PASSWORD=your_password
# --------------------------------------------
# Option 5: Gmail (requires app password)
# --------------------------------------------
# SMTP_SERVER='smtp.gmail.com'
# SMTP_PORT=587
# SMTP_USERNAME=your_email@gmail.com
# SMTP_PASSWORD=your_app_password
# --------------------------------------------
# Option 6: Office 365 / Outlook
# --------------------------------------------
# SMTP_SERVER='smtp.office365.com'
# SMTP_PORT=587
# SMTP_USERNAME=your_email@outlook.com
# SMTP_PASSWORD=your_password
# ============================================
# Notes
# ============================================
#
# 1. The container automatically detects /16 subnet for relay
# Additional networks can be added via SMTP_NETWORKS
#
# 2. All logs are sent to stderr and visible via:
# docker logs postfix-relay
#
# 3. TLS is automatically enabled for known providers
# (Maileroo, Mailtrap, SendGrid)
#
# 4. Health check monitors Postfix status every 30 seconds
#
# 5. For SendGrid, username must be "apikey" (literal string)
#
# ============================================