#!/usr/bin/env bash set -euo pipefail MAIL_HOSTNAME="${MAIL_HOSTNAME:-ali.ss5.xyz}" MAIL_ORIGIN_DOMAIN="${MAIL_ORIGIN_DOMAIN:-${MAIL_HOSTNAME#*.}}" postconf -e "myhostname = ${MAIL_HOSTNAME}" postconf -e "myorigin = ${MAIL_ORIGIN_DOMAIN}" postconf -e "mydestination =" postconf -e "inet_interfaces = all" postconf -e "inet_protocols = ipv4" postconf -e "mynetworks = 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16" postconf -e "smtpd_relay_restrictions = permit_mynetworks, reject_unauth_destination" postconf -e "smtp_tls_security_level = may" postconf -e "smtp_tls_loglevel = 1" postconf -e "smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt" postconf -e "smtp_helo_name = ${MAIL_HOSTNAME}" postconf -e "disable_vrfy_command = yes" postconf -e "maximal_queue_lifetime = 2d" postconf -e "bounce_queue_lifetime = 2d" postconf -e "maillog_file = /dev/stdout" newaliases || true exec postfix start-fg