Support SMTP relay configuration
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
Hopefully this doesn't bork existing relay configs
This commit is contained in:
parent
8399631c81
commit
9fa2b2d1b7
|
@ -32,4 +32,8 @@ SECRET_DB_PASSWORD_VERSION=v1
|
||||||
# SMTP
|
# SMTP
|
||||||
#COMPOSE_FILE="compose.yml:compose.mailrelay.yml"
|
#COMPOSE_FILE="compose.yml:compose.mailrelay.yml"
|
||||||
#SMTP_HOST="postfix_relay_app"
|
#SMTP_HOST="postfix_relay_app"
|
||||||
|
#SMTP_PORT=587
|
||||||
|
#SMTP_AUTH=on
|
||||||
|
#SMTP_TLS=on
|
||||||
#MAIL_FROM="wordpress@example.com"
|
#MAIL_FROM="wordpress@example.com"
|
||||||
|
#SECRET_SMTP_PASSWORD_VERSION=v1
|
||||||
|
|
2
abra.sh
2
abra.sh
|
@ -1,7 +1,7 @@
|
||||||
export PHP_UPLOADS_CONF_VERSION=v3
|
export PHP_UPLOADS_CONF_VERSION=v3
|
||||||
export ENTRYPOINT_CONF_VERSION=v2
|
export ENTRYPOINT_CONF_VERSION=v2
|
||||||
export ENTRYPOINT_MAILRELAY_CONF_VERSION=v1
|
export ENTRYPOINT_MAILRELAY_CONF_VERSION=v1
|
||||||
export MSMTP_CONF_VERSION=v1
|
export MSMTP_CONF_VERSION=v2
|
||||||
|
|
||||||
sub_wp() {
|
sub_wp() {
|
||||||
CONTAINER=$(docker container ls -f "Name=${STACK_NAME}_app" --format '{{ .ID }}')
|
CONTAINER=$(docker container ls -f "Name=${STACK_NAME}_app" --format '{{ .ID }}')
|
||||||
|
|
|
@ -4,8 +4,13 @@ version: "3.8"
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
entrypoint: /docker-entrypoint.mailrelay.sh
|
entrypoint: /docker-entrypoint.mailrelay.sh
|
||||||
|
secrets:
|
||||||
|
- smtp_password
|
||||||
environment:
|
environment:
|
||||||
- SMTP_HOST=${SMTP_HOST}
|
- SMTP_HOST=${SMTP_HOST}
|
||||||
|
- SMTP_PORT=${SMTP_PORT}
|
||||||
|
- SMTP_AUTH=${SMTP_AUTH}
|
||||||
|
- SMTP_TLS=${SMTP_TLS}
|
||||||
- MAIL_FROM=${MAIL_FROM}
|
- MAIL_FROM=${MAIL_FROM}
|
||||||
configs:
|
configs:
|
||||||
- source: mstmp_conf
|
- source: mstmp_conf
|
||||||
|
@ -23,3 +28,8 @@ configs:
|
||||||
name: ${STACK_NAME}_entrypoint_mailrelay_${ENTRYPOINT_MAILRELAY_CONF_VERSION}
|
name: ${STACK_NAME}_entrypoint_mailrelay_${ENTRYPOINT_MAILRELAY_CONF_VERSION}
|
||||||
file: entrypoint.mailrelay.sh.tmpl
|
file: entrypoint.mailrelay.sh.tmpl
|
||||||
template_driver: golang
|
template_driver: golang
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
smtp_password:
|
||||||
|
name: ${STACK_NAME}_smtp_password_${SECRET_SMTP_PASSWORD_VERSION}
|
||||||
|
external: true
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
account default
|
account default
|
||||||
host {{ env "SMTP_HOST" }}
|
host {{ env "SMTP_HOST" }}
|
||||||
from {{ env "MAIL_FROM" }}
|
from {{ env "MAIL_FROM" }}
|
||||||
|
port {{ env "SMTP_PORT" }}
|
||||||
|
|
||||||
|
{{ if eq (env "SMTP_AUTH") "on" }}
|
||||||
|
auth {{ env "SMTP_AUTH" }}
|
||||||
|
passwordeval "cat /run/secrets/smtp_password"
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if eq (env "SMTP_TLS") "on" }}
|
||||||
|
tls {{ env "SMTP_TLS" }}
|
||||||
|
tls_trust_file /etc/ssl/certs/ca-certificates.crt
|
||||||
|
{{ end }}
|
||||||
|
|
Loading…
Reference in New Issue