services:
  smtp-relay:
    image: loganmarchione/docker-postfixrelay:latest
    container_name: smtp_relay
    restart: always
    ports:
      - "25:25"
    environment:
      # 1. THE UPSTREAM SMARTHOST (Where mail goes)
      - RELAY_HOST=${RELAY_HOST}
      - RELAY_PORT=${RELAY_PORT}

      # 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:
      # Optional: Persist the mail queue so you don't lose alerts if the container restarts
      - /docker/smtp-relay/queue:/var/spool/postfix
