commit 697e3e8120ce3f4a8404c3500686531a8cf76e0a Author: Sebastian Hugentobler Date: Wed Jul 6 10:58:48 2016 +0200 initial commit 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 =