Switch to using Podop in Dovecot
This commit is contained in:
5
core/dovecot/conf/auth.conf
Normal file
5
core/dovecot/conf/auth.conf
Normal file
@@ -0,0 +1,5 @@
|
||||
uri = proxy:/tmp/podop.socket:auth
|
||||
iterate_disable = yes
|
||||
default_pass_scheme = plain
|
||||
password_key = passdb/%u
|
||||
user_key = userdb/%u
|
||||
@@ -1,18 +0,0 @@
|
||||
driver = sqlite
|
||||
connect = /data/main.db
|
||||
|
||||
# Return the user hashed password
|
||||
password_query = \
|
||||
SELECT NULL as password, 'Y' as nopassword, '{% if POD_ADDRESS_RANGE %}{{ POD_ADDRESS_RANGE }}{% else %}{{ FRONT_ADDRESS }}{% if WEBMAIL_ADDRESS %},{{ WEBMAIL_ADDRESS }}{% endif %}{% endif %}' as allow_nets \
|
||||
FROM user \
|
||||
WHERE user.email = '%u'
|
||||
|
||||
# Mostly get the user quota
|
||||
user_query = \
|
||||
SELECT '*:bytes=' || user.quota_bytes AS quota_rule \
|
||||
FROM user \
|
||||
WHERE user.email = '%u'
|
||||
|
||||
# For using doveadm -A:
|
||||
iterate_query = \
|
||||
SELECT user.email AS user FROM user
|
||||
@@ -7,17 +7,6 @@ postmaster_address = {{ POSTMASTER }}@{{ DOMAIN }}
|
||||
hostname = {{ HOSTNAMES.split(",")[0] }}
|
||||
submission_host = {{ FRONT_ADDRESS }}
|
||||
|
||||
service dict {
|
||||
unix_listener dict {
|
||||
group = mail
|
||||
mode = 0660
|
||||
}
|
||||
}
|
||||
|
||||
dict {
|
||||
sieve = sqlite:/etc/dovecot/pigeonhole-sieve.dict
|
||||
}
|
||||
|
||||
###############
|
||||
# Mailboxes
|
||||
###############
|
||||
@@ -36,28 +25,18 @@ mail_plugins = $mail_plugins quota quota_clone
|
||||
|
||||
namespace inbox {
|
||||
inbox = yes
|
||||
mailbox Trash {
|
||||
{% for mailbox in ("Trash", "Drafts", "Sent", "Junk") %}
|
||||
mailbox {{ mailbox }} {
|
||||
auto = subscribe
|
||||
special_use = \Trash
|
||||
}
|
||||
mailbox Drafts {
|
||||
auto = subscribe
|
||||
special_use = \Drafts
|
||||
}
|
||||
mailbox Sent {
|
||||
auto = subscribe
|
||||
special_use = \Sent
|
||||
}
|
||||
mailbox Junk {
|
||||
auto = subscribe
|
||||
special_use = \Junk
|
||||
special_use = \{{ mailbox }}
|
||||
}
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
plugin {
|
||||
quota = count:User quota
|
||||
quota_vsizes = yes
|
||||
quota_clone_dict = redis:host={{ REDIS_ADDRESS }}:port=6379:db=1
|
||||
quota_clone_dict = proxy:/tmp/podop.socket:quota
|
||||
}
|
||||
|
||||
###############
|
||||
@@ -65,16 +44,15 @@ plugin {
|
||||
###############
|
||||
auth_mechanisms = plain login
|
||||
disable_plaintext_auth = no
|
||||
ssl_protocols = !SSLv3
|
||||
|
||||
passdb {
|
||||
driver = sql
|
||||
args = /etc/dovecot/dovecot-sql.conf.ext
|
||||
driver = dict
|
||||
args = /etc/dovecot/auth.conf
|
||||
}
|
||||
|
||||
userdb {
|
||||
driver = sql
|
||||
args = /etc/dovecot/dovecot-sql.conf.ext
|
||||
driver = dict
|
||||
args = /etc/dovecot/auth.conf
|
||||
}
|
||||
|
||||
service auth {
|
||||
@@ -95,7 +73,6 @@ service auth-worker {
|
||||
###############
|
||||
# IMAP & POP
|
||||
###############
|
||||
|
||||
protocol imap {
|
||||
mail_plugins = $mail_plugins imap_quota imap_sieve
|
||||
}
|
||||
@@ -113,7 +90,6 @@ service imap-login {
|
||||
###############
|
||||
# Delivery
|
||||
###############
|
||||
|
||||
protocol lmtp {
|
||||
mail_plugins = $mail_plugins sieve
|
||||
recipient_delimiter = {{ RECIPIENT_DELIMITER }}
|
||||
@@ -125,11 +101,9 @@ service lmtp {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
###############
|
||||
# Filtering
|
||||
###############
|
||||
|
||||
service managesieve-login {
|
||||
inet_listener sieve {
|
||||
port = 4190
|
||||
@@ -140,13 +114,12 @@ service managesieve {
|
||||
}
|
||||
|
||||
plugin {
|
||||
sieve = file:~/sieve;active=~/.dovecot.sieve
|
||||
sieve_plugins = sieve_extdata sieve_imapsieve sieve_extprograms
|
||||
sieve_global_extensions = +vnd.dovecot.extdata +spamtest +spamtestplus +vnd.dovecot.execute +editheader
|
||||
sieve = dict:proxy:/tmp/podop.socket:sieve
|
||||
sieve_plugins = sieve_imapsieve sieve_extprograms
|
||||
sieve_global_extensions = +spamtest +spamtestplus +vnd.dovecot.execute +editheader
|
||||
sieve_before = /var/lib/dovecot/before.sieve
|
||||
sieve_default = /var/lib/dovecot/default.sieve
|
||||
sieve_after = /var/lib/dovecot/after.sieve
|
||||
sieve_extdata_dict_uri = proxy::sieve
|
||||
|
||||
# Sieve execute
|
||||
sieve_execute_bin_dir = /var/lib/dovecot/bin
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
connect = /data/main.db
|
||||
|
||||
map {
|
||||
pattern = priv/spam_enabled
|
||||
table = user
|
||||
username_field = email
|
||||
value_field = spam_enabled
|
||||
}
|
||||
|
||||
map {
|
||||
pattern = priv/spam_threshold
|
||||
table = user
|
||||
username_field = email
|
||||
value_field = spam_threshold
|
||||
}
|
||||
|
||||
map {
|
||||
pattern = priv/reply_enabled
|
||||
table = user
|
||||
username_field = email
|
||||
value_field = reply_enabled
|
||||
}
|
||||
|
||||
map {
|
||||
pattern = priv/reply_subject
|
||||
table = user
|
||||
username_field = email
|
||||
value_field = reply_subject
|
||||
}
|
||||
|
||||
map {
|
||||
pattern = priv/reply_body
|
||||
table = user
|
||||
username_field = email
|
||||
value_field = reply_body
|
||||
}
|
||||
|
||||
map {
|
||||
pattern = priv/reply_enddate
|
||||
table = user
|
||||
username_field = email
|
||||
value_field = reply_enddate
|
||||
}
|
||||
Reference in New Issue
Block a user