From 697e3e8120ce3f4a8404c3500686531a8cf76e0a Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Wed, 6 Jul 2016 10:58:48 +0200 Subject: [PATCH] initial commit --- .gitignore | 3 +++ Dockerfile | 14 +++++++++++ rootfs/etc/confd/conf.d/10-auth.conf.toml | 3 +++ rootfs/etc/confd/conf.d/10-logging.conf.toml | 3 +++ rootfs/etc/confd/conf.d/10-mail.conf.toml | 3 +++ rootfs/etc/confd/conf.d/10-master.conf.toml | 3 +++ rootfs/etc/confd/conf.d/10-ssl.conf.toml | 3 +++ rootfs/etc/confd/conf.d/15-lda.conf.toml | 3 +++ rootfs/etc/confd/conf.d/20-imap.conf.toml | 3 +++ rootfs/etc/confd/conf.d/20-lmtp.conf.toml | 3 +++ rootfs/etc/confd/conf.d/90-sieve.conf.toml | 3 +++ .../etc/confd/conf.d/auth-ldap.conf.ext.toml | 3 +++ .../confd/conf.d/dovecot-ldap.conf.ext.toml | 3 +++ rootfs/etc/confd/conf.d/dovecot.conf.toml | 3 +++ rootfs/etc/confd/conf.d/spam.sieve.toml | 3 +++ rootfs/etc/confd/templates/10-auth.conf.tmpl | 3 +++ .../etc/confd/templates/10-logging.conf.tmpl | 1 + rootfs/etc/confd/templates/10-mail.conf.tmpl | 24 ++++++++++++++++++ .../etc/confd/templates/10-master.conf.tmpl | 25 +++++++++++++++++++ rootfs/etc/confd/templates/10-ssl.conf.tmpl | 7 ++++++ rootfs/etc/confd/templates/15-lda.conf.tmpl | 8 ++++++ rootfs/etc/confd/templates/20-imap.conf.tmpl | 3 +++ rootfs/etc/confd/templates/20-lmtp.conf.tmpl | 3 +++ rootfs/etc/confd/templates/90-sieve.conf.tmpl | 3 +++ .../confd/templates/auth-ldap.conf.ext.tmpl | 9 +++++++ .../templates/dovecot-ldap.conf.ext.tmpl | 11 ++++++++ rootfs/etc/confd/templates/dovecot.conf.tmpl | 4 +++ rootfs/etc/confd/templates/spam.sieve.tmpl | 6 +++++ rootfs/etc/fix-attrs.d/00-mails | 1 + rootfs/etc/services.d/dovecot/run | 3 +++ 30 files changed, 167 insertions(+) create mode 100755 .gitignore create mode 100644 Dockerfile create mode 100644 rootfs/etc/confd/conf.d/10-auth.conf.toml create mode 100644 rootfs/etc/confd/conf.d/10-logging.conf.toml create mode 100644 rootfs/etc/confd/conf.d/10-mail.conf.toml create mode 100644 rootfs/etc/confd/conf.d/10-master.conf.toml create mode 100644 rootfs/etc/confd/conf.d/10-ssl.conf.toml create mode 100644 rootfs/etc/confd/conf.d/15-lda.conf.toml create mode 100644 rootfs/etc/confd/conf.d/20-imap.conf.toml create mode 100644 rootfs/etc/confd/conf.d/20-lmtp.conf.toml create mode 100644 rootfs/etc/confd/conf.d/90-sieve.conf.toml create mode 100644 rootfs/etc/confd/conf.d/auth-ldap.conf.ext.toml create mode 100644 rootfs/etc/confd/conf.d/dovecot-ldap.conf.ext.toml create mode 100644 rootfs/etc/confd/conf.d/dovecot.conf.toml create mode 100644 rootfs/etc/confd/conf.d/spam.sieve.toml create mode 100644 rootfs/etc/confd/templates/10-auth.conf.tmpl create mode 100644 rootfs/etc/confd/templates/10-logging.conf.tmpl create mode 100644 rootfs/etc/confd/templates/10-mail.conf.tmpl create mode 100644 rootfs/etc/confd/templates/10-master.conf.tmpl create mode 100644 rootfs/etc/confd/templates/10-ssl.conf.tmpl create mode 100644 rootfs/etc/confd/templates/15-lda.conf.tmpl create mode 100644 rootfs/etc/confd/templates/20-imap.conf.tmpl create mode 100644 rootfs/etc/confd/templates/20-lmtp.conf.tmpl create mode 100644 rootfs/etc/confd/templates/90-sieve.conf.tmpl create mode 100644 rootfs/etc/confd/templates/auth-ldap.conf.ext.tmpl create mode 100644 rootfs/etc/confd/templates/dovecot-ldap.conf.ext.tmpl create mode 100644 rootfs/etc/confd/templates/dovecot.conf.tmpl create mode 100644 rootfs/etc/confd/templates/spam.sieve.tmpl create mode 100644 rootfs/etc/fix-attrs.d/00-mails create mode 100644 rootfs/etc/services.d/dovecot/run diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..af0faab --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*~ +.DS_Store +*.swp diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9c3db02 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM thallian/confd-env:latest + +RUN apk add --no-cache dovecot dovecot-ldap dovecot-pigeonhole-plugin + +RUN mkdir /etc/dovecot/sieve-after/ + +RUN addgroup vmail +RUN adduser -h /var/lib/vmail -D -G vmail vmail + +EXPOSE 6334 7777 + +VOLUME /var/lib/vmail/mail/ /etc/ssl/mail + +ADD /rootfs / diff --git a/rootfs/etc/confd/conf.d/10-auth.conf.toml b/rootfs/etc/confd/conf.d/10-auth.conf.toml new file mode 100644 index 0000000..4dab3a5 --- /dev/null +++ b/rootfs/etc/confd/conf.d/10-auth.conf.toml @@ -0,0 +1,3 @@ +[template] +src = "10-auth.conf.tmpl" +dest = "/etc/dovecot/conf.d/10-auth.conf" diff --git a/rootfs/etc/confd/conf.d/10-logging.conf.toml b/rootfs/etc/confd/conf.d/10-logging.conf.toml new file mode 100644 index 0000000..c299993 --- /dev/null +++ b/rootfs/etc/confd/conf.d/10-logging.conf.toml @@ -0,0 +1,3 @@ +[template] +src = "10-logging.conf.tmpl" +dest = "/etc/dovecot/conf.d/10-logging.conf" diff --git a/rootfs/etc/confd/conf.d/10-mail.conf.toml b/rootfs/etc/confd/conf.d/10-mail.conf.toml new file mode 100644 index 0000000..f61ccec --- /dev/null +++ b/rootfs/etc/confd/conf.d/10-mail.conf.toml @@ -0,0 +1,3 @@ +[template] +src = "10-mail.conf.tmpl" +dest = "/etc/dovecot/conf.d/10-mail.conf" diff --git a/rootfs/etc/confd/conf.d/10-master.conf.toml b/rootfs/etc/confd/conf.d/10-master.conf.toml new file mode 100644 index 0000000..1e7c36d --- /dev/null +++ b/rootfs/etc/confd/conf.d/10-master.conf.toml @@ -0,0 +1,3 @@ +[template] +src = "10-master.conf.tmpl" +dest = "/etc/dovecot/conf.d/10-master.conf" diff --git a/rootfs/etc/confd/conf.d/10-ssl.conf.toml b/rootfs/etc/confd/conf.d/10-ssl.conf.toml new file mode 100644 index 0000000..e1f7bb3 --- /dev/null +++ b/rootfs/etc/confd/conf.d/10-ssl.conf.toml @@ -0,0 +1,3 @@ +[template] +src = "10-ssl.conf.tmpl" +dest = "/etc/dovecot/conf.d/10-ssl.conf" diff --git a/rootfs/etc/confd/conf.d/15-lda.conf.toml b/rootfs/etc/confd/conf.d/15-lda.conf.toml new file mode 100644 index 0000000..618f83c --- /dev/null +++ b/rootfs/etc/confd/conf.d/15-lda.conf.toml @@ -0,0 +1,3 @@ +[template] +src = "15-lda.conf.tmpl" +dest = "/etc/dovecot/conf.d/15-lda.conf" diff --git a/rootfs/etc/confd/conf.d/20-imap.conf.toml b/rootfs/etc/confd/conf.d/20-imap.conf.toml new file mode 100644 index 0000000..db30380 --- /dev/null +++ b/rootfs/etc/confd/conf.d/20-imap.conf.toml @@ -0,0 +1,3 @@ +[template] +src = "20-imap.conf.tmpl" +dest = "/etc/dovecot/conf.d/20-imap.conf" diff --git a/rootfs/etc/confd/conf.d/20-lmtp.conf.toml b/rootfs/etc/confd/conf.d/20-lmtp.conf.toml new file mode 100644 index 0000000..5e8db25 --- /dev/null +++ b/rootfs/etc/confd/conf.d/20-lmtp.conf.toml @@ -0,0 +1,3 @@ +[template] +src = "20-lmtp.conf.tmpl" +dest = "/etc/dovecot/conf.d/20-lmtp.conf" diff --git a/rootfs/etc/confd/conf.d/90-sieve.conf.toml b/rootfs/etc/confd/conf.d/90-sieve.conf.toml new file mode 100644 index 0000000..8c288d0 --- /dev/null +++ b/rootfs/etc/confd/conf.d/90-sieve.conf.toml @@ -0,0 +1,3 @@ +[template] +src = "90-sieve.conf.tmpl" +dest = "/etc/dovecot/conf.d/90-sieve.conf" diff --git a/rootfs/etc/confd/conf.d/auth-ldap.conf.ext.toml b/rootfs/etc/confd/conf.d/auth-ldap.conf.ext.toml new file mode 100644 index 0000000..4a883bb --- /dev/null +++ b/rootfs/etc/confd/conf.d/auth-ldap.conf.ext.toml @@ -0,0 +1,3 @@ +[template] +src = "auth-ldap.conf.ext.tmpl" +dest = "/etc/dovecot/conf.d/auth-ldap.conf.ext" diff --git a/rootfs/etc/confd/conf.d/dovecot-ldap.conf.ext.toml b/rootfs/etc/confd/conf.d/dovecot-ldap.conf.ext.toml new file mode 100644 index 0000000..58fe3df --- /dev/null +++ b/rootfs/etc/confd/conf.d/dovecot-ldap.conf.ext.toml @@ -0,0 +1,3 @@ +[template] +src = "dovecot-ldap.conf.ext.tmpl" +dest = "/etc/dovecot/dovecot-ldap.conf.ext" diff --git a/rootfs/etc/confd/conf.d/dovecot.conf.toml b/rootfs/etc/confd/conf.d/dovecot.conf.toml new file mode 100644 index 0000000..171e8c6 --- /dev/null +++ b/rootfs/etc/confd/conf.d/dovecot.conf.toml @@ -0,0 +1,3 @@ +[template] +src = "dovecot.conf.tmpl" +dest = "/etc/dovecot/dovecot.conf" diff --git a/rootfs/etc/confd/conf.d/spam.sieve.toml b/rootfs/etc/confd/conf.d/spam.sieve.toml new file mode 100644 index 0000000..aabc538 --- /dev/null +++ b/rootfs/etc/confd/conf.d/spam.sieve.toml @@ -0,0 +1,3 @@ +[template] +src = "spam.sieve.tmpl" +dest = "/etc/dovecot/sieve-after/spam.sieve" diff --git a/rootfs/etc/confd/templates/10-auth.conf.tmpl b/rootfs/etc/confd/templates/10-auth.conf.tmpl new file mode 100644 index 0000000..4409fdc --- /dev/null +++ b/rootfs/etc/confd/templates/10-auth.conf.tmpl @@ -0,0 +1,3 @@ +auth_username_chars = {{getenv "ALLOWEDUSERNAMECHARS"}} +auth_mechanisms = {{getenv "AUTHMECHANISMS"}} +!include auth-ldap.conf.ext diff --git a/rootfs/etc/confd/templates/10-logging.conf.tmpl b/rootfs/etc/confd/templates/10-logging.conf.tmpl new file mode 100644 index 0000000..1bf3a23 --- /dev/null +++ b/rootfs/etc/confd/templates/10-logging.conf.tmpl @@ -0,0 +1 @@ +log_path = /dev/stderr diff --git a/rootfs/etc/confd/templates/10-mail.conf.tmpl b/rootfs/etc/confd/templates/10-mail.conf.tmpl new file mode 100644 index 0000000..fb1f0f4 --- /dev/null +++ b/rootfs/etc/confd/templates/10-mail.conf.tmpl @@ -0,0 +1,24 @@ +mail_location = maildir:/var/lib/vmail/mail/%d/%n/Maildir +namespace inbox { + separator = / + inbox = yes + mailbox Junk { + auto = subscribe + special_use = \Junk + } + + mailbox Trash { + auto = subscribe + special_use = \Trash + } + + mailbox Sent { + auto = subscribe + special_use = \Sent + } + + mailbox Drafts { + auto = subscribe + special_use = \Drafts + } +} diff --git a/rootfs/etc/confd/templates/10-master.conf.tmpl b/rootfs/etc/confd/templates/10-master.conf.tmpl new file mode 100644 index 0000000..2f8c9cc --- /dev/null +++ b/rootfs/etc/confd/templates/10-master.conf.tmpl @@ -0,0 +1,25 @@ +service imap-login { + inet_listener imap { + port = 143 + } +} + +service lmtp { + inet_listener lmtp { + address = 127.0.0.1 + port = 7777 + } +} + +service imap { +} + +service auth { + inet_listener postfix { + address = 127.0.0.1 + port = 6334 + } +} + +service auth-worker { +} diff --git a/rootfs/etc/confd/templates/10-ssl.conf.tmpl b/rootfs/etc/confd/templates/10-ssl.conf.tmpl new file mode 100644 index 0000000..0bb4d42 --- /dev/null +++ b/rootfs/etc/confd/templates/10-ssl.conf.tmpl @@ -0,0 +1,7 @@ +ssl = yes +ssl_cert =