[Dovecot] Fix maildir_gc, build with ldap support
parent
9acd9c719d
commit
c82f8165d8
|
@ -15,6 +15,7 @@ RUN apt-get update && apt-get -y --no-install-recommends install \
|
||||||
curl \
|
curl \
|
||||||
default-libmysqlclient-dev \
|
default-libmysqlclient-dev \
|
||||||
dnsutils \
|
dnsutils \
|
||||||
|
gettext \
|
||||||
jq \
|
jq \
|
||||||
libjson-webtoken-perl \
|
libjson-webtoken-perl \
|
||||||
libcgi-pm-perl \
|
libcgi-pm-perl \
|
||||||
|
@ -40,6 +41,7 @@ RUN apt-get update && apt-get -y --no-install-recommends install \
|
||||||
libio-socket-ssl-perl \
|
libio-socket-ssl-perl \
|
||||||
libio-tee-perl \
|
libio-tee-perl \
|
||||||
libipc-run-perl \
|
libipc-run-perl \
|
||||||
|
libldap2-dev \
|
||||||
liblockfile-simple-perl \
|
liblockfile-simple-perl \
|
||||||
liblz-dev \
|
liblz-dev \
|
||||||
liblz4-dev \
|
liblz4-dev \
|
||||||
|
@ -75,7 +77,7 @@ RUN apt-get update && apt-get -y --no-install-recommends install \
|
||||||
|
|
||||||
RUN curl https://www.dovecot.org/releases/2.3/dovecot-$DOVECOT_VERSION.tar.gz | tar xvz \
|
RUN curl https://www.dovecot.org/releases/2.3/dovecot-$DOVECOT_VERSION.tar.gz | tar xvz \
|
||||||
&& cd dovecot-$DOVECOT_VERSION \
|
&& cd dovecot-$DOVECOT_VERSION \
|
||||||
&& ./configure --with-solr --with-mysql --with-lzma --with-lz4 --with-ssl=openssl --with-notify=inotify --with-storages=mdbox,sdbox,maildir,mbox,imapc,pop3c --with-bzlib --with-zlib --enable-hardening \
|
&& ./configure --with-solr --with-mysql --with-ldap --with-lzma --with-lz4 --with-ssl=openssl --with-notify=inotify --with-storages=mdbox,sdbox,maildir,mbox,imapc,pop3c --with-bzlib --with-zlib --enable-hardening \
|
||||||
&& make -j3 \
|
&& make -j3 \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& make clean \
|
&& make clean \
|
||||||
|
|
|
@ -97,7 +97,7 @@ EOF
|
||||||
# Create pass dict for Dovecot
|
# Create pass dict for Dovecot
|
||||||
cat <<EOF > /usr/local/etc/dovecot/sql/dovecot-dict-sql-passdb.conf
|
cat <<EOF > /usr/local/etc/dovecot/sql/dovecot-dict-sql-passdb.conf
|
||||||
driver = mysql
|
driver = mysql
|
||||||
connect = "host=/var/run/mysqld/mysqld.sock dbname=${DBNAME} user=${DBUSER} password=${DBPASS} ssl_verify_server_cert=no ssl_ca=/etc/ssl/certs/ca-certificates.crt"
|
connect = "host=/var/run/mysqld/mysqld.sock dbname=${DBNAME} user=${DBUSER} password=${DBPASS}"
|
||||||
default_pass_scheme = SSHA256
|
default_pass_scheme = SSHA256
|
||||||
password_query = SELECT password FROM mailbox WHERE username = '%u' AND domain IN (SELECT domain FROM domain WHERE domain='%d' AND active='1') AND JSON_EXTRACT(attributes, '$.force_pw_update') NOT LIKE '%%1%%'
|
password_query = SELECT password FROM mailbox WHERE username = '%u' AND domain IN (SELECT domain FROM domain WHERE domain='%d' AND active='1') AND JSON_EXTRACT(attributes, '$.force_pw_update') NOT LIKE '%%1%%'
|
||||||
EOF
|
EOF
|
||||||
|
@ -153,6 +153,9 @@ rm -f /tmp/imapsync_busy.lock
|
||||||
IMAPSYNC_TABLE=$(mysql --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "SHOW TABLES LIKE 'imapsync'" -Bs)
|
IMAPSYNC_TABLE=$(mysql --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "SHOW TABLES LIKE 'imapsync'" -Bs)
|
||||||
[[ ! -z ${IMAPSYNC_TABLE} ]] && mysql --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "UPDATE imapsync SET is_running='0'"
|
[[ ! -z ${IMAPSYNC_TABLE} ]] && mysql --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "UPDATE imapsync SET is_running='0'"
|
||||||
|
|
||||||
|
# Envsubst maildir_gc
|
||||||
|
envsubst < /usr/local/bin/maildir_gc.sh > /usr/local/bin/maildir_gc.sh
|
||||||
|
|
||||||
# Collect SA rules once now
|
# Collect SA rules once now
|
||||||
/usr/local/bin/sa-rules.sh
|
/usr/local/bin/sa-rules.sh
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue