User Tools

This is an old revision of the document!


Configuring Dovecot

dovecot.conf
log_path = syslog
syslog_facility = mail
mail_debug = no
auth_debug = no
auth_debug_passwords = no
auth_verbose = no
base_dir = /var/run/dovecot/
listen = *
protocols = imap sieve 
login_greeting = IMAPD ready.

# Mailbox setup
mail_location = maildir:/home/vmail/storage/%d/%n/maildir
namespace inbox { 
  inbox = yes
}
mail_uid = 5000
mail_gid = 5000
mailbox_list_index = yes
mailbox_idle_check_interval = 30 secs
maildir_copy_with_hardlinks = yes

# Sieve
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date

# Authentication and login
disable_plaintext_auth = yes
auth_default_realm = mydomain.com
auth_mechanisms = plain login
auth_realms = mydomain.com
auth_failure_delay = 2 secs

# SQLite link
sql_driver = sqlite
sqlite_path = /home/vmail/database/vmail.sqlite3
passdb sql {
  query = SELECT username, domain, password FROM mailbox WHERE username = '%u' AND active = 1
}
userdb sql {
  query = SELECT CONCAT('/home/vmail/storage/', maildir) AS home, CONCAT('maildir:storage=', quota) AS quota FROM mailbox WHERE username = '%u' AND active = 1
  iterate_query = SELECT username AS user FROM mailbox
}

service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0660
    user = postfix
  }
}

# SSL TLS setup
ssl = yes
ssl_cert = </etc/letsencrypt/live/mail.mydomain.com/fullchain.pem
ssl_key = </etc/letsencrypt/live/mail.mydomain.com/privkey.pem
ssl_min_protocol = TLSv1.2
ssl_cipher_list = ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES256-GCM-SHA384

This website uses technical cookies only. No information is shared with anybody or used in any way but provide the website in your browser.

More information