mirror of
https://github.com/bokysan/docker-postfix.git
synced 2025-09-05 05:54:51 +08:00
Hopefully this exampels will help people get up to speed and deploy the solution faster. They show how the image can be used in different scenarios, e.g.: - as a MTA for Dovecot with `docker-compose` - as an outgoing queue towards AWS SES or Google Mail through `helm` - as an outgoing queue towards Sendgrid through `helm`
70 lines
1.8 KiB
YAML
70 lines
1.8 KiB
YAML
replicaCount: 1
|
|
resources:
|
|
limits:
|
|
cpu: 200m
|
|
memory: 128Mi
|
|
requests:
|
|
cpu: 100m
|
|
memory: 128Mi
|
|
|
|
# priorityClassName: mail
|
|
extraVolumes:
|
|
- name: config
|
|
configMap:
|
|
name: postfix-mail
|
|
extraVolumeMounts:
|
|
- mountPath: /docker-init.db/startup.sh
|
|
subPath: startup.sh
|
|
name: config
|
|
|
|
persistence:
|
|
enabled: true
|
|
storageClass: "gp3"
|
|
|
|
secret:
|
|
AWS_SMTP_SERVER: email-smtp.eu-central-1.amazonaws.com
|
|
AWS_IAM_USER: smtp-user
|
|
AWS_ACCESS_KEY: XXXXXXXXXXXXXXXXXXXX
|
|
AWS_SECRET_KEY: YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
|
|
AWS_SMTP_PASSWORD: ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
|
|
|
|
config:
|
|
general:
|
|
TZ: "Europe/London"
|
|
|
|
# Default relay with go to Google, but for example.com and example.org it will go to AWS
|
|
# No password provided for Google as it will be authenticated via IP
|
|
RELAYHOST: "smtp-relay.gmail.com:587"
|
|
ALLOWED_SENDER_DOMAINS: "example.com example.org example.net"
|
|
LOG_FORMAT: "json"
|
|
|
|
startup.sh: |
|
|
#!/bin/sh
|
|
set -e
|
|
|
|
RELAY_MAPS=/etc/postfix/relay_maps
|
|
SASL_PASSWD=/etc/postfix/sasl_passwd
|
|
|
|
: > $RELAY_MAPS
|
|
cat > $RELAY_MAPS <<EOF
|
|
@example.com [${AWS_SMTP_SERVER}]:587
|
|
@example.org [${AWS_SMTP_SERVER}]:587
|
|
EOF
|
|
postmap /etc/postfix/relay_maps
|
|
|
|
: > $SASL_PASSWD
|
|
cat > $SASL_PASSWD <<EOF
|
|
[${AWS_SMTP_SERVER}]:587 ${AWS_ACCESS_KEY}:${AWS_SMTP_PASSWORD}
|
|
EOF
|
|
|
|
postmap /etc/postfix/sasl_passwd
|
|
|
|
postfix:
|
|
sender_dependent_relayhost_maps: "lmdb:/etc/postfix/relay_maps"
|
|
smtp_sasl_auth_enable: "yes"
|
|
smtp_sasl_password_maps: "lmdb:/etc/postfix/sasl_passwd"
|
|
smtp_sasl_security_options: "noanonymous"
|
|
smtp_tls_security_level: "encrypt"
|
|
smtp_tls_note_starttls_offer: "yes"
|
|
|
|
|