initial commit

This commit is contained in:
Sebastian Hugentobler 2016-07-06 10:58:48 +02:00
commit 697e3e8120
30 changed files with 167 additions and 0 deletions

3
.gitignore vendored Executable file
View File

@ -0,0 +1,3 @@
*~
.DS_Store
*.swp

14
Dockerfile Normal file
View File

@ -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 /

View File

@ -0,0 +1,3 @@
[template]
src = "10-auth.conf.tmpl"
dest = "/etc/dovecot/conf.d/10-auth.conf"

View File

@ -0,0 +1,3 @@
[template]
src = "10-logging.conf.tmpl"
dest = "/etc/dovecot/conf.d/10-logging.conf"

View File

@ -0,0 +1,3 @@
[template]
src = "10-mail.conf.tmpl"
dest = "/etc/dovecot/conf.d/10-mail.conf"

View File

@ -0,0 +1,3 @@
[template]
src = "10-master.conf.tmpl"
dest = "/etc/dovecot/conf.d/10-master.conf"

View File

@ -0,0 +1,3 @@
[template]
src = "10-ssl.conf.tmpl"
dest = "/etc/dovecot/conf.d/10-ssl.conf"

View File

@ -0,0 +1,3 @@
[template]
src = "15-lda.conf.tmpl"
dest = "/etc/dovecot/conf.d/15-lda.conf"

View File

@ -0,0 +1,3 @@
[template]
src = "20-imap.conf.tmpl"
dest = "/etc/dovecot/conf.d/20-imap.conf"

View File

@ -0,0 +1,3 @@
[template]
src = "20-lmtp.conf.tmpl"
dest = "/etc/dovecot/conf.d/20-lmtp.conf"

View File

@ -0,0 +1,3 @@
[template]
src = "90-sieve.conf.tmpl"
dest = "/etc/dovecot/conf.d/90-sieve.conf"

View File

@ -0,0 +1,3 @@
[template]
src = "auth-ldap.conf.ext.tmpl"
dest = "/etc/dovecot/conf.d/auth-ldap.conf.ext"

View File

@ -0,0 +1,3 @@
[template]
src = "dovecot-ldap.conf.ext.tmpl"
dest = "/etc/dovecot/dovecot-ldap.conf.ext"

View File

@ -0,0 +1,3 @@
[template]
src = "dovecot.conf.tmpl"
dest = "/etc/dovecot/dovecot.conf"

View File

@ -0,0 +1,3 @@
[template]
src = "spam.sieve.tmpl"
dest = "/etc/dovecot/sieve-after/spam.sieve"

View File

@ -0,0 +1,3 @@
auth_username_chars = {{getenv "ALLOWEDUSERNAMECHARS"}}
auth_mechanisms = {{getenv "AUTHMECHANISMS"}}
!include auth-ldap.conf.ext

View File

@ -0,0 +1 @@
log_path = /dev/stderr

View File

@ -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
}
}

View File

@ -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 {
}

View File

@ -0,0 +1,7 @@
ssl = yes
ssl_cert = </etc/ssl/mail/fullchain.pem
ssl_key = </etc/ssl/mail/privkey.pem
ssl_dh_parameters_length = {{getenv "SSLDHLENGTH"}}
ssl_protocols = {{getenv "SSLPROTOCOLS"}}
ssl_cipher_list = {{getenv "SSLCIPHERLIST"}}
ssl_prefer_server_ciphers = yes

View File

@ -0,0 +1,8 @@
hostname = {{getenv "HOSTNAME"}}
recipient_delimiter = +
lda_mailbox_autocreate = yes
lda_mailbox_autosubscribe = yes
protocol lda {
mail_plugins = $mail_plugins sieve
}

View File

@ -0,0 +1,3 @@
protocol imap {
mail_max_userip_connections = {{getenv "IMAPMAXUSERCONNECTIONS"}}
}

View File

@ -0,0 +1,3 @@
protocol lmtp {
mail_plugins = $mail_plugins sieve
}

View File

@ -0,0 +1,3 @@
plugin {
sieve = file:~/sieve;active=~/.dovecot.sieve
}

View File

@ -0,0 +1,9 @@
passdb {
driver = ldap
args = /etc/dovecot/dovecot-ldap.conf.ext
}
userdb {
driver = static
args = uid=vmail gid=vmail home=/var/lib/vmail/mail/%d/%n
}

View File

@ -0,0 +1,11 @@
uris = {{getenv "LDAPURI"}}
dn = {{getenv "LDAPBINDDN"}}
dnpass = {{getenv "LDAPBINDPASSWORD"}}
tls = {{getenv "LDAPUSETLS"}}
auth_bind = no
base = {{getenv "LDAPBASEDN"}}
scope = {{getenv "LDAPSCOPE"}}
user_filter = {{getenv "LDAPUSERFILTER"}}
pass_attrs = mail=user,userPassword=password
pass_filter = {{getenv "LDAPPASSFILTER"}}
default_pass_scheme = {{getenv "LDAPDEFAULTPASSSCHEME"}}

View File

@ -0,0 +1,4 @@
protocols = imap sieve lmtp
listen = *
!include conf.d/*.conf
!include_try local.conf

View File

@ -0,0 +1,6 @@
require ["fileinto","mailbox"];
if header :contains "X-Spam-Flag" "YES" {
fileinto :create "Junk";
stop;
}

View File

@ -0,0 +1 @@
/var/lib/vmail/mail true vmail 0640 0750

View File

@ -0,0 +1,3 @@
#!/usr/bin/with-contenv sh
exec dovecot -F