initial commit
This commit is contained in:
commit
697e3e8120
3
.gitignore
vendored
Executable file
3
.gitignore
vendored
Executable file
@ -0,0 +1,3 @@
|
||||
*~
|
||||
.DS_Store
|
||||
*.swp
|
14
Dockerfile
Normal file
14
Dockerfile
Normal 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 /
|
3
rootfs/etc/confd/conf.d/10-auth.conf.toml
Normal file
3
rootfs/etc/confd/conf.d/10-auth.conf.toml
Normal file
@ -0,0 +1,3 @@
|
||||
[template]
|
||||
src = "10-auth.conf.tmpl"
|
||||
dest = "/etc/dovecot/conf.d/10-auth.conf"
|
3
rootfs/etc/confd/conf.d/10-logging.conf.toml
Normal file
3
rootfs/etc/confd/conf.d/10-logging.conf.toml
Normal file
@ -0,0 +1,3 @@
|
||||
[template]
|
||||
src = "10-logging.conf.tmpl"
|
||||
dest = "/etc/dovecot/conf.d/10-logging.conf"
|
3
rootfs/etc/confd/conf.d/10-mail.conf.toml
Normal file
3
rootfs/etc/confd/conf.d/10-mail.conf.toml
Normal file
@ -0,0 +1,3 @@
|
||||
[template]
|
||||
src = "10-mail.conf.tmpl"
|
||||
dest = "/etc/dovecot/conf.d/10-mail.conf"
|
3
rootfs/etc/confd/conf.d/10-master.conf.toml
Normal file
3
rootfs/etc/confd/conf.d/10-master.conf.toml
Normal file
@ -0,0 +1,3 @@
|
||||
[template]
|
||||
src = "10-master.conf.tmpl"
|
||||
dest = "/etc/dovecot/conf.d/10-master.conf"
|
3
rootfs/etc/confd/conf.d/10-ssl.conf.toml
Normal file
3
rootfs/etc/confd/conf.d/10-ssl.conf.toml
Normal file
@ -0,0 +1,3 @@
|
||||
[template]
|
||||
src = "10-ssl.conf.tmpl"
|
||||
dest = "/etc/dovecot/conf.d/10-ssl.conf"
|
3
rootfs/etc/confd/conf.d/15-lda.conf.toml
Normal file
3
rootfs/etc/confd/conf.d/15-lda.conf.toml
Normal file
@ -0,0 +1,3 @@
|
||||
[template]
|
||||
src = "15-lda.conf.tmpl"
|
||||
dest = "/etc/dovecot/conf.d/15-lda.conf"
|
3
rootfs/etc/confd/conf.d/20-imap.conf.toml
Normal file
3
rootfs/etc/confd/conf.d/20-imap.conf.toml
Normal file
@ -0,0 +1,3 @@
|
||||
[template]
|
||||
src = "20-imap.conf.tmpl"
|
||||
dest = "/etc/dovecot/conf.d/20-imap.conf"
|
3
rootfs/etc/confd/conf.d/20-lmtp.conf.toml
Normal file
3
rootfs/etc/confd/conf.d/20-lmtp.conf.toml
Normal file
@ -0,0 +1,3 @@
|
||||
[template]
|
||||
src = "20-lmtp.conf.tmpl"
|
||||
dest = "/etc/dovecot/conf.d/20-lmtp.conf"
|
3
rootfs/etc/confd/conf.d/90-sieve.conf.toml
Normal file
3
rootfs/etc/confd/conf.d/90-sieve.conf.toml
Normal file
@ -0,0 +1,3 @@
|
||||
[template]
|
||||
src = "90-sieve.conf.tmpl"
|
||||
dest = "/etc/dovecot/conf.d/90-sieve.conf"
|
3
rootfs/etc/confd/conf.d/auth-ldap.conf.ext.toml
Normal file
3
rootfs/etc/confd/conf.d/auth-ldap.conf.ext.toml
Normal file
@ -0,0 +1,3 @@
|
||||
[template]
|
||||
src = "auth-ldap.conf.ext.tmpl"
|
||||
dest = "/etc/dovecot/conf.d/auth-ldap.conf.ext"
|
3
rootfs/etc/confd/conf.d/dovecot-ldap.conf.ext.toml
Normal file
3
rootfs/etc/confd/conf.d/dovecot-ldap.conf.ext.toml
Normal file
@ -0,0 +1,3 @@
|
||||
[template]
|
||||
src = "dovecot-ldap.conf.ext.tmpl"
|
||||
dest = "/etc/dovecot/dovecot-ldap.conf.ext"
|
3
rootfs/etc/confd/conf.d/dovecot.conf.toml
Normal file
3
rootfs/etc/confd/conf.d/dovecot.conf.toml
Normal file
@ -0,0 +1,3 @@
|
||||
[template]
|
||||
src = "dovecot.conf.tmpl"
|
||||
dest = "/etc/dovecot/dovecot.conf"
|
3
rootfs/etc/confd/conf.d/spam.sieve.toml
Normal file
3
rootfs/etc/confd/conf.d/spam.sieve.toml
Normal file
@ -0,0 +1,3 @@
|
||||
[template]
|
||||
src = "spam.sieve.tmpl"
|
||||
dest = "/etc/dovecot/sieve-after/spam.sieve"
|
3
rootfs/etc/confd/templates/10-auth.conf.tmpl
Normal file
3
rootfs/etc/confd/templates/10-auth.conf.tmpl
Normal file
@ -0,0 +1,3 @@
|
||||
auth_username_chars = {{getenv "ALLOWEDUSERNAMECHARS"}}
|
||||
auth_mechanisms = {{getenv "AUTHMECHANISMS"}}
|
||||
!include auth-ldap.conf.ext
|
1
rootfs/etc/confd/templates/10-logging.conf.tmpl
Normal file
1
rootfs/etc/confd/templates/10-logging.conf.tmpl
Normal file
@ -0,0 +1 @@
|
||||
log_path = /dev/stderr
|
24
rootfs/etc/confd/templates/10-mail.conf.tmpl
Normal file
24
rootfs/etc/confd/templates/10-mail.conf.tmpl
Normal 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
|
||||
}
|
||||
}
|
25
rootfs/etc/confd/templates/10-master.conf.tmpl
Normal file
25
rootfs/etc/confd/templates/10-master.conf.tmpl
Normal 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 {
|
||||
}
|
7
rootfs/etc/confd/templates/10-ssl.conf.tmpl
Normal file
7
rootfs/etc/confd/templates/10-ssl.conf.tmpl
Normal 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
|
8
rootfs/etc/confd/templates/15-lda.conf.tmpl
Normal file
8
rootfs/etc/confd/templates/15-lda.conf.tmpl
Normal 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
|
||||
}
|
3
rootfs/etc/confd/templates/20-imap.conf.tmpl
Normal file
3
rootfs/etc/confd/templates/20-imap.conf.tmpl
Normal file
@ -0,0 +1,3 @@
|
||||
protocol imap {
|
||||
mail_max_userip_connections = {{getenv "IMAPMAXUSERCONNECTIONS"}}
|
||||
}
|
3
rootfs/etc/confd/templates/20-lmtp.conf.tmpl
Normal file
3
rootfs/etc/confd/templates/20-lmtp.conf.tmpl
Normal file
@ -0,0 +1,3 @@
|
||||
protocol lmtp {
|
||||
mail_plugins = $mail_plugins sieve
|
||||
}
|
3
rootfs/etc/confd/templates/90-sieve.conf.tmpl
Normal file
3
rootfs/etc/confd/templates/90-sieve.conf.tmpl
Normal file
@ -0,0 +1,3 @@
|
||||
plugin {
|
||||
sieve = file:~/sieve;active=~/.dovecot.sieve
|
||||
}
|
9
rootfs/etc/confd/templates/auth-ldap.conf.ext.tmpl
Normal file
9
rootfs/etc/confd/templates/auth-ldap.conf.ext.tmpl
Normal 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
|
||||
}
|
11
rootfs/etc/confd/templates/dovecot-ldap.conf.ext.tmpl
Normal file
11
rootfs/etc/confd/templates/dovecot-ldap.conf.ext.tmpl
Normal 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"}}
|
4
rootfs/etc/confd/templates/dovecot.conf.tmpl
Normal file
4
rootfs/etc/confd/templates/dovecot.conf.tmpl
Normal file
@ -0,0 +1,4 @@
|
||||
protocols = imap sieve lmtp
|
||||
listen = *
|
||||
!include conf.d/*.conf
|
||||
!include_try local.conf
|
6
rootfs/etc/confd/templates/spam.sieve.tmpl
Normal file
6
rootfs/etc/confd/templates/spam.sieve.tmpl
Normal file
@ -0,0 +1,6 @@
|
||||
require ["fileinto","mailbox"];
|
||||
|
||||
if header :contains "X-Spam-Flag" "YES" {
|
||||
fileinto :create "Junk";
|
||||
stop;
|
||||
}
|
1
rootfs/etc/fix-attrs.d/00-mails
Normal file
1
rootfs/etc/fix-attrs.d/00-mails
Normal file
@ -0,0 +1 @@
|
||||
/var/lib/vmail/mail true vmail 0640 0750
|
3
rootfs/etc/services.d/dovecot/run
Normal file
3
rootfs/etc/services.d/dovecot/run
Normal file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/with-contenv sh
|
||||
|
||||
exec dovecot -F
|
Loading…
Reference in New Issue
Block a user