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 \