From 65e15b036e36e2a7b53fc8a2efff133932825617 Mon Sep 17 00:00:00 2001 From: Alex Palaistras Date: Sun, 21 Mar 2021 00:18:36 +0000 Subject: [PATCH] postfix: Correct use of invalid `POSTFIX_` env These were likely due to copy-paste misses, and cause issues with connecting to the underlying mail database. --- .../container/config/{master.cf.template => master.cf} | 0 .../postfix/container/config/mysql-alias.cf.template | 8 ++++---- .../postfix/container/config/mysql-domains.cf.template | 8 ++++---- .../postfix/container/config/mysql-mailbox.cf.template | 8 ++++---- config/service/postfix/postfix.env.template | 6 ++++++ config/service/postfix/postfix.service | 1 - 6 files changed, 18 insertions(+), 13 deletions(-) rename config/service/postfix/container/config/{master.cf.template => master.cf} (100%) diff --git a/config/service/postfix/container/config/master.cf.template b/config/service/postfix/container/config/master.cf similarity index 100% rename from config/service/postfix/container/config/master.cf.template rename to config/service/postfix/container/config/master.cf diff --git a/config/service/postfix/container/config/mysql-alias.cf.template b/config/service/postfix/container/config/mysql-alias.cf.template index 03c68dd..6716708 100644 --- a/config/service/postfix/container/config/mysql-alias.cf.template +++ b/config/service/postfix/container/config/mysql-alias.cf.template @@ -1,7 +1,7 @@ -hosts = ${PROSODY_DATABASE_HOST} -user = ${PROSODY_DATABASE_USERNAME} -password = ${PROSODY_DATABASE_PASSWORD} -dbname = ${PROSODY_DATABASE_NAME} +hosts = ${POSTFIX_DATABASE_HOST} +user = ${POSTFIX_DATABASE_USERNAME} +password = ${POSTFIX_DATABASE_PASSWORD} +dbname = ${POSTFIX_DATABASE_NAME} table = aliases select_field = destination where_field = mail diff --git a/config/service/postfix/container/config/mysql-domains.cf.template b/config/service/postfix/container/config/mysql-domains.cf.template index 7b92f7d..9a8863d 100644 --- a/config/service/postfix/container/config/mysql-domains.cf.template +++ b/config/service/postfix/container/config/mysql-domains.cf.template @@ -1,7 +1,7 @@ -hosts = ${PROSODY_DATABASE_HOST} -user = ${PROSODY_DATABASE_USERNAME} -password = ${PROSODY_DATABASE_PASSWORD} -dbname = ${PROSODY_DATABASE_NAME} +hosts = ${POSTFIX_DATABASE_HOST} +user = ${POSTFIX_DATABASE_USERNAME} +password = ${POSTFIX_DATABASE_PASSWORD} +dbname = ${POSTFIX_DATABASE_NAME} table = domains select_field = domain where_field = domain diff --git a/config/service/postfix/container/config/mysql-mailbox.cf.template b/config/service/postfix/container/config/mysql-mailbox.cf.template index f9ebc67..14d6b29 100644 --- a/config/service/postfix/container/config/mysql-mailbox.cf.template +++ b/config/service/postfix/container/config/mysql-mailbox.cf.template @@ -1,7 +1,7 @@ -hosts = ${PROSODY_DATABASE_HOST} -user = ${PROSODY_DATABASE_USERNAME} -password = ${PROSODY_DATABASE_PASSWORD} -dbname = ${PROSODY_DATABASE_NAME} +hosts = ${POSTFIX_DATABASE_HOST} +user = ${POSTFIX_DATABASE_USERNAME} +password = ${POSTFIX_DATABASE_PASSWORD} +dbname = ${POSTFIX_DATABASE_NAME} table = users select_field = maildir where_field = username diff --git a/config/service/postfix/postfix.env.template b/config/service/postfix/postfix.env.template index 56d2cb0..c9d9059 100644 --- a/config/service/postfix/postfix.env.template +++ b/config/service/postfix/postfix.env.template @@ -4,6 +4,12 @@ POSTFIX_MAIL_SASL_PATH=inet:dovecot:3659 POSTFIX_MAIL_MILTER_PATH=inet:rspamd:11332 POSTFIX_MAIL_TRANSPORT_PATH=lmtp:inet:dovecot:24 +# Database options. +POSTFIX_DATABASE_HOST=mariadb +POSTFIX_DATABASE_NAME=${DOVECOT_DATABASE_NAME} +POSTFIX_DATABASE_USERNAME=${DOVECOT_DATABASE_USERNAME} +POSTFIX_DATABASE_PASSWORD=${DOVECOT_DATABASE_PASSWORD} + # Service user options. POSTFIX_LOCAL_SMTP_USERNAME=${POSTFIX_LOCAL_SMTP_USERNAME} POSTFIX_LOCAL_SMTP_PASSWORD=${POSTFIX_LOCAL_SMTP_PASSWORD} diff --git a/config/service/postfix/postfix.service b/config/service/postfix/postfix.service index 6e448bc..529658a 100644 --- a/config/service/postfix/postfix.service +++ b/config/service/postfix/postfix.service @@ -7,7 +7,6 @@ After=container-build@%N.service container-network@mail.service container-networ Restart=always ExecStartPre=/bin/install --owner 5000 --group 5000 -d /var/lib/container-service/mail ExecStartPre=/bin/podman create --replace --pull never --net internal,mail --env-file /etc/container-service/%N/%N.env \ - --env-file /etc/container-service/dovecot/dovecot.env \ --publish 25:25 --publish 465:465 --publish 587:587 \ --volume /var/lib/container-service/mail:/var/mail:z \ --volume /var/lib/container-service/letsencrypt/private:/etc/ssl/private:z \