mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2026-11-20 23:43:26 +03:00
update dovecot 2.4 example config to not log deletions by default. thanks @TrapoSAMA
466 lines
11 KiB
Plaintext
466 lines
11 KiB
Plaintext
# Dovecot 2.4 example configuration for PostfixAdmin.
|
|
# Review hostnames, paths, users, groups, database names and passwords.
|
|
#
|
|
# This file must be included by the active Dovecot configuration.
|
|
#
|
|
# Preferred Dovecot 2.4 layout for this example: keep the PostfixAdmin SQL auth,
|
|
# storage, quota, Sieve and migration settings together in one local file, then
|
|
# include it explicitly from the end of dovecot.conf:
|
|
# !include_try /etc/dovecot/local.conf
|
|
#
|
|
# If you intentionally replace an older conf.d split layout, the end of
|
|
# dovecot.conf can be:
|
|
# #!include_try conf.d/*.conf
|
|
# !include_try local.conf
|
|
#
|
|
# Only comment out conf.d/*.conf after reviewing package defaults and moving
|
|
# any required local settings into local.conf. Alternatively, install this as a
|
|
# late conf.d file such as /etc/dovecot/conf.d/99-postfixadmin-local.conf.
|
|
# Validate with doveconf -n.
|
|
|
|
ssl = yes
|
|
ssl_server_cert_file = /etc/letsencrypt/live/server.domain.com/fullchain.pem
|
|
ssl_server_key_file = /etc/letsencrypt/live/server.domain.com/privkey.pem
|
|
ssl_server_alt_cert_file = /etc/letsencrypt/live/server-rsa.domain.com/fullchain.pem
|
|
ssl_server_alt_key_file = /etc/letsencrypt/live/server-rsa.domain.com/privkey.pem
|
|
|
|
# Set this to yes only while old MD5 / MD5-CRYPT hashes still need to work.
|
|
# Disable it again after migrating active users to stronger hashes.
|
|
auth_allow_weak_schemes = no
|
|
|
|
ssl_min_protocol = TLSv1.2
|
|
ssl_cipher_list = PROFILE=SYSTEM
|
|
ssl_server_prefer_ciphers = client
|
|
|
|
login_log_format_elements = user=<%{user}> method=%{mechanism} rip=%{remote_ip} lip=%{local_ip} session=<%{session}> tls=%{ssl_security}
|
|
login_greeting = IMAPS/POP3S only ready.
|
|
|
|
mail_driver = maildir
|
|
mail_path = /var/vmail/%{user | domain}/%{user | username}
|
|
mail_home = /var/vmail/%{user | domain}/%{user | username}
|
|
mail_uid = vmail
|
|
mail_gid = mail
|
|
mail_privileged_group = mail
|
|
first_valid_uid = 150
|
|
last_valid_uid = 150
|
|
|
|
mail_max_userip_connections = 100
|
|
mailbox_list_index = yes
|
|
imap_idle_notify_interval = 24mins
|
|
|
|
auth_cache_ttl = 5mins
|
|
auth_cache_size = 50M
|
|
auth_cache_negative_ttl = 5mins
|
|
auth_cache_verify_password_with_worker = no
|
|
auth_allow_cleartext = no
|
|
auth_mechanisms = plain login
|
|
default_internal_user = dovecot
|
|
|
|
sql_driver = mysql
|
|
|
|
mysql 127.0.0.1 {
|
|
dbname = postfix
|
|
user = postfix
|
|
password = DATABASE_PASSWORD
|
|
}
|
|
|
|
service imap-login {
|
|
inet_listener imap {
|
|
port = 0
|
|
}
|
|
inet_listener imaps {
|
|
port = 993
|
|
ssl = yes
|
|
}
|
|
client_limit = 1000
|
|
process_limit = 200
|
|
process_min_avail = 20
|
|
}
|
|
|
|
service pop3-login {
|
|
inet_listener pop3 {
|
|
port = 0
|
|
}
|
|
inet_listener pop3s {
|
|
port = 995
|
|
ssl = yes
|
|
}
|
|
}
|
|
|
|
service lmtp {
|
|
unix_listener /var/spool/postfix/private/dovecot-lmtp {
|
|
mode = 0600
|
|
user = postfix
|
|
group = postfix
|
|
}
|
|
process_limit = 16
|
|
}
|
|
|
|
service auth {
|
|
unix_listener auth-userdb {
|
|
mode = 0600
|
|
user = vmail
|
|
group = mail
|
|
}
|
|
unix_listener /var/spool/postfix/private/auth {
|
|
mode = 0660
|
|
user = postfix
|
|
group = postfix
|
|
}
|
|
user = $SET:default_internal_user
|
|
client_limit = 1000
|
|
}
|
|
|
|
service auth-worker {
|
|
user = vmail
|
|
process_limit = 50
|
|
}
|
|
|
|
namespace inbox {
|
|
type = private
|
|
inbox = yes
|
|
prefix =
|
|
separator = /
|
|
list = yes
|
|
|
|
mailbox Drafts {
|
|
auto = subscribe
|
|
special_use = \Drafts
|
|
}
|
|
mailbox Junk {
|
|
auto = subscribe
|
|
special_use = \Junk
|
|
autoexpunge = 30d
|
|
sieve_script spam {
|
|
cause = copy
|
|
# Optional IMAPSieve spam learning. Install examples/sieve/report-spam.sieve
|
|
# and its helper under sieve_pipe_bin_dir before enabling this.
|
|
path = /var/vmail/sieve/bin/report-spam.sieve
|
|
type = after
|
|
}
|
|
}
|
|
imapsieve_from Junk {
|
|
sieve_script ham {
|
|
cause = copy
|
|
# Optional IMAPSieve ham learning. Install examples/sieve/report-ham.sieve
|
|
# and its helper under sieve_pipe_bin_dir before enabling this.
|
|
path = /var/vmail/sieve/bin/report-ham.sieve
|
|
type = after
|
|
}
|
|
}
|
|
mailbox Trash {
|
|
auto = subscribe
|
|
special_use = \Trash
|
|
autoexpunge = 30d
|
|
quota_storage_extra = 200M
|
|
}
|
|
mailbox Sent {
|
|
auto = subscribe
|
|
special_use = \Sent
|
|
}
|
|
mailbox "Sent Messages" {
|
|
auto = create
|
|
}
|
|
}
|
|
|
|
namespace shared {
|
|
type = shared
|
|
prefix = Shared/$user/
|
|
separator = /
|
|
mail_path = %{owner_home}
|
|
mail_index_private_path = ~/shared/%{owner_user}
|
|
subscriptions = no
|
|
list = children
|
|
}
|
|
|
|
mail_plugins {
|
|
acl = yes
|
|
quota = yes
|
|
quota_clone = yes
|
|
fts = yes
|
|
fts_flatcurve = yes
|
|
}
|
|
|
|
# Optional detailed message and mailbox deletion logging. Uncomment these
|
|
# settings and the mail_log/notify IMAP plugins below to enable it.
|
|
#mail_log_events = delete undelete expunge mailbox_delete
|
|
#mail_log_fields = uid box msgid size from subject
|
|
|
|
acl_driver = vfile
|
|
|
|
acl_sharing_map {
|
|
dict file {
|
|
path = /var/lib/dovecot/acl/shared-mailboxes.db
|
|
}
|
|
}
|
|
|
|
protocol imap {
|
|
mail_plugins {
|
|
imap_quota = yes
|
|
imap_acl = yes
|
|
imap_sieve = yes
|
|
# Enable together with mail_log_events and mail_log_fields above.
|
|
#mail_log = yes
|
|
#notify = yes
|
|
fts = yes
|
|
fts_flatcurve = yes
|
|
}
|
|
}
|
|
|
|
fts flatcurve {
|
|
commit_limit = 500
|
|
min_term_size = 2
|
|
}
|
|
fts_autoindex = yes
|
|
|
|
language es {
|
|
default = yes
|
|
tokenizers = generic
|
|
}
|
|
language en {
|
|
tokenizers = generic
|
|
}
|
|
language_tokenizer_generic_algorithm = simple
|
|
|
|
protocol lmtp {
|
|
mail_plugins {
|
|
quota = yes
|
|
quota_clone = yes
|
|
sieve = yes
|
|
}
|
|
postmaster_address = postmaster@domain.com
|
|
}
|
|
|
|
protocol pop3 {
|
|
mail_plugins {
|
|
quota = yes
|
|
quota_clone = yes
|
|
}
|
|
}
|
|
|
|
pop3_no_flag_updates = yes
|
|
pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
|
|
|
|
quota "User Quota" {
|
|
driver = count
|
|
enforce = yes
|
|
storage_grace = 50M
|
|
|
|
warning warn-95 {
|
|
quota_storage_percentage = 95
|
|
execute quota-warning {
|
|
args = 95 %{user}
|
|
}
|
|
}
|
|
warning warn-90 {
|
|
quota_storage_percentage = 90
|
|
execute quota-warning {
|
|
args = 90 %{user}
|
|
}
|
|
}
|
|
warning warn-under {
|
|
quota_storage_percentage = 100
|
|
threshold = under
|
|
execute quota-warning {
|
|
args = below %{user}
|
|
}
|
|
}
|
|
}
|
|
|
|
service quota-warning {
|
|
# Install examples/quota-warning.sh as /usr/local/bin/quota-warning.sh
|
|
# before enabling quota warnings in production.
|
|
executable = script /usr/local/bin/quota-warning.sh
|
|
user = vmail
|
|
unix_listener quota-warning {
|
|
mode = 0660
|
|
user = vmail
|
|
group = mail
|
|
}
|
|
}
|
|
|
|
quota_status_success = DUNNO
|
|
quota_status_nouser = DUNNO
|
|
quota_status_overquota = 552 5.2.2 Mailbox is full
|
|
|
|
service quota-status {
|
|
executable = quota-status -p postfix
|
|
unix_listener /var/spool/postfix/private/dovecot-quota {
|
|
mode = 0660
|
|
user = postfix
|
|
group = postfix
|
|
}
|
|
client_limit = 10
|
|
}
|
|
|
|
sieve_script personal {
|
|
path = /var/vmail/%{user | domain}/%{user | username}/sieve
|
|
active_path = /var/vmail/%{user | domain}/%{user | username}/sieve/default.sieve
|
|
}
|
|
sieve_script before {
|
|
type = before
|
|
driver = file
|
|
path = /var/vmail/sieve/sieve-before.d/
|
|
}
|
|
sieve_script after {
|
|
type = after
|
|
driver = file
|
|
path = /var/vmail/sieve/sieve-after.d/
|
|
}
|
|
sieve_plugins = sieve_imapsieve sieve_extprograms
|
|
sieve_extensions {
|
|
copy = yes
|
|
vnd.dovecot.pipe = yes
|
|
}
|
|
# Helper scripts referenced by report-spam.sieve / report-ham.sieve are looked
|
|
# up relative to this directory.
|
|
sieve_pipe_bin_dir = /var/vmail/sieve/bin
|
|
|
|
service indexer-worker {
|
|
vsz_limit = 2G
|
|
process_limit = 4
|
|
}
|
|
|
|
dict_server {
|
|
dict mysql {
|
|
driver = sql
|
|
sql_driver = mysql
|
|
mysql 127.0.0.1 {
|
|
dbname = postfix
|
|
user = postfix
|
|
password = DATABASE_PASSWORD
|
|
}
|
|
dict_map "priv/quota/messages" {
|
|
dict_map_pattern = "priv/quota/messages"
|
|
sql_table = quota2
|
|
dict_map_username_field = username
|
|
dict_map_value_field messages {
|
|
type = uint
|
|
}
|
|
}
|
|
dict_map "priv/quota/storage" {
|
|
dict_map_pattern = "priv/quota/storage"
|
|
sql_table = quota2
|
|
dict_map_username_field = username
|
|
dict_map_value_field bytes {
|
|
type = uint
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
quota_clone {
|
|
dict proxy {
|
|
name = mysql
|
|
}
|
|
}
|
|
|
|
service dict {
|
|
unix_listener dict {
|
|
mode = 0660
|
|
user = vmail
|
|
group = mail
|
|
}
|
|
}
|
|
|
|
protocols {
|
|
imap = yes
|
|
pop3 = yes
|
|
lmtp = yes
|
|
sieve = yes
|
|
}
|
|
|
|
service managesieve-login {
|
|
inet_listener sieve {
|
|
port = 4190
|
|
}
|
|
process_min_avail = 0
|
|
vsz_limit = 1024M
|
|
}
|
|
|
|
service stats {
|
|
unix_listener stats-reader {
|
|
user = vmail
|
|
mode = 0660
|
|
}
|
|
unix_listener stats-writer {
|
|
user = apache
|
|
mode = 0660
|
|
}
|
|
}
|
|
|
|
passdb sql {
|
|
default_password_scheme = ARGON2ID
|
|
|
|
# Normal query:
|
|
query = SELECT username AS user, password FROM mailbox WHERE username = '%{user}' AND active = '1'
|
|
|
|
# Password migration query. Use temporarily with dovecot-upgrade-pass.sh,
|
|
# then revert to the normal query above.
|
|
# query = SELECT username AS user, password, '%{password}' AS userdb_plain_pass FROM mailbox WHERE username = '%{user}' AND active = '1'
|
|
}
|
|
|
|
userdb sql {
|
|
# Standard Maildir-only query:
|
|
query = SELECT '/var/vmail/%{user | domain}/%{user | username}' AS home, 150 AS uid, 12 AS gid, CONCAT(quota, 'B') AS quota_storage_size FROM mailbox WHERE username = '%{user}' AND active = '1'
|
|
|
|
# Optional per-user Maildir/mdbox query. Requires a local mailbox.mail_format
|
|
# field with values such as 'maildir' and 'mdbox'.
|
|
# query = SELECT '/var/vmail/%{user | domain}/%{user | username}' AS home, 150 AS uid, 12 AS gid, CONCAT(quota, 'B') AS quota_storage_size, CASE WHEN mail_format = 'mdbox' THEN 'mdbox' ELSE 'maildir' END AS mail_driver, CONCAT('/var/vmail/', '%{user | domain}/', '%{user | username}') AS mail_path FROM mailbox WHERE username = '%{user}' AND active = '1'
|
|
|
|
iterate_query = SELECT username AS user FROM mailbox WHERE active = '1'
|
|
}
|
|
|
|
userdb prefetch {
|
|
}
|
|
|
|
service imap {
|
|
# Normal mode:
|
|
executable = imap
|
|
|
|
# Optional password migration mode:
|
|
# Enable this only together with:
|
|
# - the passdb query that returns userdb_plain_pass
|
|
# - service imap-postlogin executable below
|
|
# - an installed and reviewed dovecot-upgrade-pass.sh script
|
|
# executable = imap imap-postlogin
|
|
vsz_limit = 1024M
|
|
}
|
|
|
|
service imap-postlogin {
|
|
# Optional password migration mode:
|
|
# Enable only during a controlled password hash migration window.
|
|
# executable = script-login /usr/local/bin/dovecot-upgrade-pass.sh
|
|
unix_listener imap-postlogin {
|
|
mode = 0660
|
|
user = $SET:default_internal_user
|
|
}
|
|
}
|
|
|
|
service pop3 {
|
|
# Normal mode:
|
|
executable = pop3
|
|
|
|
# Optional password migration mode:
|
|
# Enable this only together with:
|
|
# - the passdb query that returns userdb_plain_pass
|
|
# - service pop3-postlogin executable below
|
|
# - an installed and reviewed dovecot-upgrade-pass.sh script
|
|
# executable = pop3 pop3-postlogin
|
|
}
|
|
|
|
service pop3-postlogin {
|
|
# Optional password migration mode:
|
|
# Enable only during a controlled password hash migration window.
|
|
# executable = script-login /usr/local/bin/dovecot-upgrade-pass.sh
|
|
unix_listener pop3-postlogin {
|
|
mode = 0660
|
|
user = $SET:default_internal_user
|
|
}
|
|
}
|
|
|
|
# Debug only. WARNING: enabling this may log plaintext passwords.
|
|
# Never enable it on production systems or shared logs.
|
|
#auth_verbose = yes
|
|
#auth_verbose_passwords = plain
|