services: smtp-relay: image: loganmarchione/docker-postfixrelay:latest container_name: smtp_relay_node${SMTP_NODE_ID} restart: always ports: - "2525:25" environment: # 1. THE UPSTREAM SMARTHOST (Where mail goes) - RELAY_HOST=${RELAY_HOST} - RELAY_PORT=${RELAY_PORT} - RELAY_USERNAME=${RELAY_USER} - RELAY_PASSWORD=${RELAY_PASS} # 2. INTERNAL SECURITY (Who can send) # Allow your entire subnet (e.g., 192.168.1.0/24) to send without auth - MYNETWORKS=${RELAY_NETWORKS} # 3. IDENTIFICATION # The hostname this relay announces itself as - SYSTEM_TIMEZONE=America/Edmonton - MESSAGE_SIZE_LIMIT=10240000 volumes: # QUEUE PERSISTENCE (Critical for HA) # If Node 1 dies, Node 2 sees the pending mail queue on Gluster - /docker/smtp-relay/queue:/var/spool/postfix networks: - smtp_external # Attached to Traefik network just in case, or for internal access networks: smtp_external: external: true