From 74cbe1ffed1b207e9584e97382321e2db257fd35 Mon Sep 17 00:00:00 2001 From: Julian Hille Date: Thu, 17 Aug 2017 00:17:46 +0200 Subject: [PATCH] Add missing files and fix typo in package. --- Dockerfile | 5 +++-- target/dovecot/dovecot-mysql.conf.ext | 8 ++++++++ target/postfix/mysql.cf | 5 +++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 target/dovecot/dovecot-mysql.conf.ext create mode 100644 target/postfix/mysql.cf diff --git a/Dockerfile b/Dockerfile index b7e3e704..9477e6af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -57,7 +57,7 @@ RUN apt-get update -q --fix-missing && \ pax \ p7zip-full \ postfix-ldap \ - postifx-mysql \ + postfix-mysql \ postfix-policyd-spf-python \ pyzor \ rar \ @@ -115,7 +115,8 @@ RUN sed -i -e 's/include_try \/usr\/share\/dovecot\/protocols\.d/include_try \/e # Configures LDAP COPY target/dovecot/dovecot-ldap.conf.ext /etc/dovecot -COPY target/postfix/ldap-users.cf target/postfix/ldap-groups.cf target/postfix/ldap-aliases.cf /etc/postfix/ +COPY target/dovecot/dovecot-mysql.conf.ext /etc/dovecot +COPY target/postfix/mysql.cf target/postfix/ldap-users.cf target/postfix/ldap-groups.cf target/postfix/ldap-aliases.cf /etc/postfix/ # Enables Spamassassin CRON updates RUN sed -i -r 's/^(CRON)=0/\1=1/g' /etc/default/spamassassin diff --git a/target/dovecot/dovecot-mysql.conf.ext b/target/dovecot/dovecot-mysql.conf.ext new file mode 100644 index 00000000..b4f49c1d --- /dev/null +++ b/target/dovecot/dovecot-mysql.conf.ext @@ -0,0 +1,8 @@ +driver = mysql +connect = "host=127.0.0.1 dbname=vmail user=vmail password=vmaildbpass" +default_pass_scheme = SHA512-CRYPT + +password_query = SELECT username AS user, domain, password FROM accounts WHERE username = '%n' AND domain = '%d' and enabled = true; + +user_query = SELECT concat('*:storage=', quota, 'M') AS quota_rule FROM accounts WHERE username = '%n' AND domain = '%d' AND sendonly = false; +iterate_query = SELECT username, domain FROM accounts where sendonly = false; \ No newline at end of file diff --git a/target/postfix/mysql.cf b/target/postfix/mysql.cf new file mode 100644 index 00000000..b6eae2a2 --- /dev/null +++ b/target/postfix/mysql.cf @@ -0,0 +1,5 @@ +hosts = +user = +password = +dbname = +query = SELECT 1 FROM transport WHERE domain= '%s \ No newline at end of file