Files
mail-hosting/etc/dovecot/dovecot.conf
T

226 lines
4.7 KiB
Plaintext

#general settings
dovecot_config_version = 2.4.0
dovecot_storage_version = 2.4.0
listen = *, ::
login_greeting = Server ready.
mmap_disable = yes
mail_fsync = always
mail_nfs_index = yes
mail_nfs_storage = yes
auth_verbose = no
auth_verbose_passwords = no
auth_debug = no
auth_debug_passwords = no
mail_debug = no
mail_driver = maildir
mail_path = /var/mail/vmail/%{user | domain}/%{user | username}
mail_home = /var/mail/vmail/%{user | domain}/%{user | username}
mail_plugins {
mail_compress = yes
mail_crypt = yes
}
mailbox_list_index = yes
mail_always_cache_fields = date.save
imap_hibernate_timeout = 5s
mail_attribute {
dict file {
path = %{home}/dovecot-attributes
}
}
crypt_global_private_key main {
crypt_private_key_file = /etc/dovecot/ecprivkey.pem
}
crypt_global_public_key_file = /etc/dovecot/ecpubkey.pem
mail_compress_write_method = gz
# sieve = file:~/sieve;active=~/.dovecot.sieve
sieve_script personal {
driver = file
path = ~/sieve
active_path = ~/.dovecot.sieve
}
# sieve_plugins = sieve_imapsieve
sieve_plugins {
sieve_imapsieve = yes
}
imapsieve_url = sieve://danwin1210.de
#}
#auth settings
auth_cache_size = 1M
auth_cache_ttl = 5mins
auth_cache_negative_ttl = 5mins
auth_default_domain = danwin1210.de
auth_username_chars =
auth_mechanisms = plain login
auth_allow_weak_schemes = yes
#TLS parameters
ssl = required
ssl_server_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
ssl_server_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
ssl_client_ca_dir = /etc/ssl/certs
ssl_server_dh_file = /etc/dovecot/dh.pem
ssl_min_protocol = TLSv1.2
ssl_cipher_list = HIGH:!PSK:!aNULL:!MD5:!SHA:!CAMELLIA:!AES+SHA256:!AES+SHA384;
ssl_curve_list = X448:X25519:secp521r1:secp384r1
ssl_server_prefer_ciphers = server
#protocol setup
protocols = "imap pop3 lmtp sieve"
protocol imap {
mail_plugins {
imap_sieve = yes
last_login = yes
}
imap_metadata = yes
}
protocol pop3 {
mail_plugins {
last_login = yes
}
imap_metadata = yes
}
protocol lmtp {
mail_plugins {
sieve = yes
}
}
protocol sieve {
mail_plugins {
last_login = yes
}
}
#service setup
service anvil {
unix_listener anvil {
mode = 0666
}
}
service auth {
unix_listener auth-userdb {
mode = 0666
user = postfix
group = postfix
}
unix_listener /var/spool/postfix/private/auth {
mode = 0666
user = postfix
group = postfix
}
inet_listener auth-port {
port = 12345
}
user = dovecot
group = dovecot
client_limit=2448
}
service auth-worker {
unix_listener auth-worker {
mode = 0666
user = dovecot
group = dovecot
}
}
service imap {
service_restart_request_count = 1000
client_limit = 1
unix_listener imap-master {
user = dovecot
}
}
service imap-login {
inet_listener imap {
port = 143
}
service_restart_request_count = 1000
vsz_limit = 1G
process_min_avail = 1
}
service lmtp {
unix_listener /var/spool/postfix/private/dovecot-lmtp {
mode = 0660
user = postfix
group = postfix
}
user = vmail
group = vmail
}
service pop3 {
service_restart_request_count = 1000
client_limit = 1
}
service pop3-login {
inet_listener pop3 {
port = 110
}
service_restart_request_count = 1000
vsz_limit = 1G
}
passdb sql {
driver = sql
query = SELECT username AS user, CONCAT(password_hash_type, password) AS password, 5000 AS userdb_uid, 5000 AS userdb_gid, CONCAT('*:bytes=', quota) AS userdb_quota_rule FROM mailbox WHERE username = CONCAT('%{user | username}', '@', COALESCE((SELECT target_domain FROM alias_domain WHERE alias_domain = '%{user | domain}' AND active='1'), '%{user | domain}')) AND active='1'
}
userdb sql {
driver = sql
query = SELECT 5000 AS uid, 5000 AS gid, CONCAT('*:bytes=', quota) AS quota_rule FROM mailbox WHERE username = CONCAT('%{user | username}', '@', COALESCE((SELECT target_domain FROM alias_domain WHERE alias_domain = '%{user | domain}' AND active='1'), '%{user | domain}')) AND active='1'
iterate_query = SELECT username AS user FROM mailbox
}
#namespace configuration
namespace inbox {
inbox = yes
mailbox Drafts {
auto = subscribe
special_use = \Drafts
}
mailbox Junk {
special_use = \Junk
}
mailbox Trash {
auto = subscribe
special_use = \Trash
autoexpunge = 30d
}
mailbox Sent {
auto = subscribe
special_use = \Sent
}
mailbox "Sent Messages" {
special_use = \Sent
}
}
mysql localhost {
dbname=postfix
user=postfix
password=YOUR_PASSWORD
}
sql_driver = mysql
last_login {
dict proxy {
name = sql
}
key = last-login/%{user}
precision = s
}
dict_server {
dict sql {
dict_map shared/last-login/$user {
sql_table = mailbox
value_field last_login {
type = uint
}
key_field username {
value = $user
}
}
}
}