From ea17d1396020c2f7fb6c75c99c372a2a201506bf Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Wed, 24 Aug 2016 13:04:00 +0200 Subject: [PATCH] pigeonhole plugin with ldap support --- Dockerfile | 10 +++++++++- rootfs/etc/confd/conf.d/sieve-ldap.conf.toml | 3 +++ rootfs/etc/confd/templates/90-sieve.conf.tmpl | 2 +- rootfs/etc/confd/templates/sieve-ldap.conf.tmpl | 12 ++++++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 rootfs/etc/confd/conf.d/sieve-ldap.conf.toml create mode 100644 rootfs/etc/confd/templates/sieve-ldap.conf.tmpl diff --git a/Dockerfile b/Dockerfile index 166231c..2f02a3d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,14 @@ FROM thallian/confd-env:latest -RUN apk add --no-cache dovecot dovecot-ldap dovecot-pigeonhole-plugin ssmtp +RUN apk add --no-cache dovecot dovecot-ldap ssmtp g++ openldap-dev dovecot-dev make + +RUN mkdir /tmp/pigeonhole +RUN wget -qO- http://pigeonhole.dovecot.org/releases/2.2/dovecot-2.2-pigeonhole-0.4.15.tar.gz | tar -xz -C /tmp/pigeonhole --strip 1 +WORKDIR /tmp/pigeonhole +RUN ./configure --with-ldap=yes --with-dovecot=/usr/lib/dovecot +RUN make && make install + +RUN apk del g++ openldap-dev dovecot-dev make RUN addgroup -g 1111 vmail RUN adduser -u 1111 -h /var/lib/vmail -D -G vmail vmail diff --git a/rootfs/etc/confd/conf.d/sieve-ldap.conf.toml b/rootfs/etc/confd/conf.d/sieve-ldap.conf.toml new file mode 100644 index 0000000..db4b2f5 --- /dev/null +++ b/rootfs/etc/confd/conf.d/sieve-ldap.conf.toml @@ -0,0 +1,3 @@ +[template] +src = "sieve-ldap.conf.tmpl" +dest = "/etc/dovecot/sieve-ldap.conf" diff --git a/rootfs/etc/confd/templates/90-sieve.conf.tmpl b/rootfs/etc/confd/templates/90-sieve.conf.tmpl index b3c13bb..0bd3437 100644 --- a/rootfs/etc/confd/templates/90-sieve.conf.tmpl +++ b/rootfs/etc/confd/templates/90-sieve.conf.tmpl @@ -3,6 +3,6 @@ protocol sieve { } plugin { - sieve = file:~/sieve;active=~/.dovecot.sieve + sieve = ldap:/etc/dovecot/sieve-ldap.conf;bindir=~/.sieve-bin/ sieve_after = /var/lib/vmail/sieve-after/ } diff --git a/rootfs/etc/confd/templates/sieve-ldap.conf.tmpl b/rootfs/etc/confd/templates/sieve-ldap.conf.tmpl new file mode 100644 index 0000000..d2ac42c --- /dev/null +++ b/rootfs/etc/confd/templates/sieve-ldap.conf.tmpl @@ -0,0 +1,12 @@ +hosts = {{getenv "LDAPSIEVEHOST"}} +dn = {{getenv "LDAPBINDDN"}} +dnpass = {{getenv "LDAPBINDPASSWORD"}} +sasl_bind = no +tls = {{getenv "LDAPUSETLS"}} +ldap_version = 3 +base = {{getenv "LDAPBASEDN"}} +deref = never +scope = subtree +sieve_ldap_filter = {{getenv "LDAPUSERFILTER"}} +sieve_ldap_script_attr = {{getenv "LDAPSIEVEATTRIBUTE"}} +sieve_ldap_mod_attr = modifyTimestamp