## Dovecot configuration file

# PLEASE DON'T EDIT ANYTHING IN THIS FILE! ANY CHANGES WILL BE LOST ON UPGRADE.
# Instead add your custom configuration to /etc/dovecot/conf.d/
# See the end of this file for details on customization.

# See example configuration files in /usr/share/doc/dovecot/example-config/
# See stock configuration files in /usr/share/doc/plesk-dovecot/dist-config/

# Dovecot storage file format version. It specifies the oldest Dovecot version
# that must be able to read files written by this Dovecot instance. The
# intention is that when upgrading Dovecot cluster, this setting is first kept
# as the old Dovecot version. Once the cluster is fully upgraded to a new
# version and there is no intention to rollback to the old version anymore,
# this version number can be increased.
dovecot_config_version = 2.4.1

# Dovecot storage file format version. It specifies the oldest Dovecot version
# that must be able to read files written by this Dovecot instance. The
# intention is that when upgrading Dovecot cluster, this setting is first kept
# as the old Dovecot version. Once the cluster is fully upgraded to a new
# version and there is no intention to rollback to the old version anymore,
# this version number can be increased.
dovecot_storage_version = 2.4.1


# Space separated list of wanted authentication mechanisms.
# NOTE: See also auth_allow_cleartext setting.
auth_mechanisms = plain login digest-md5 cram-md5 apop

# Valid UID range should include popuser.
first_valid_uid = 30

# List of allowed characters in username. "'&" is added here to the default list.
auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890&.-_@'

# Weak schemas are disabled by default, so we have to enable them.
auth_allow_weak_schemes = yes

# Plesk Maildirs layout.
mail_home = /var/qmail/mailnames/%{user | domain | lower}/%{user | username | lower}
mail_driver = maildir
mail_path = /var/qmail/mailnames/%{user | domain | lower}/%{user | username | lower}/Maildir
mailbox_list_utf8 = yes

# Enable Maildir++ quota support.
mail_plugins {
  quota = yes
}

quota user {
  driver = maildir
  quota_storage_grace = 0
}


service auth {
  # Allow userdb lookups for popuser.
  unix_listener auth-userdb {
    mode = 0600
    user = popuser
    group = popuser
  }
}

service stats {
  unix_listener stats-writer {
    user = popuser
  }
}

# PEM encoded X.509 SSL/TLS certificate and private key.
ssl_server_cert_file = /etc/dovecot/private/ssl-cert-and-key.pem
ssl_server_key_file =  /etc/dovecot/private/ssl-cert-and-key.pem


# Protocols support.

protocols = imap pop3

protocol imap {
  mail_plugins {
    imap_quota = yes
  }
}

protocol pop3 {
  # POP3 UIDL format similar to the one used by Courier-IMAP.
  pop3_uidl_format = UID%{uid}-%{uidvalidity}
}

# Applicable workarounds for various client bugs.
imap_client_workarounds = delay-newmail
pop3_client_workarounds = outlook-no-nuls oe-ns-eoh


# Default private namespace setup compatible with Courier-IMAP.

namespace inbox {
  separator = .
  prefix = INBOX.
  inbox = yes

  mailbox Sent {
    auto = subscribe # autocreate and autosubscribe the Sent mailbox
    special_use = \Sent
  }
  mailbox Spam {
    auto = create # autocreate Spam, but don't autosubscribe
    special_use = \Junk
  }
  mailbox Drafts {
    auto = create
    special_use = \Drafts
  }
  mailbox Trash {
    auto = create
    special_use = \Trash
  }
}


# Logging verbosity and debugging.

# Log unsuccessful authentication attempts and the reasons why they failed.
#auth_verbose = yes

# In case of password mismatches, log the attempted password. Valid values are
# no, plain and sha1. sha1 can be useful for detecting brute force password
# attempts vs. user simply trying the same password over and over again.
#auth_verbose_passwords = no

# Even more verbose logging for debugging purposes.
#auth_debug = yes

# In case of password mismatches, log the passwords and used scheme so the
# problem can be debugged. Enabling this also enables auth_debug.
#auth_debug_passwords = yes

# Enable mail process debugging. This can help you figure out why Dovecot
# isn't finding your mails.
#mail_debug = yes

# Show protocol level SSL errors.
#verbose_ssl = yes


# Log format compatible with Plesk statistics collector.
mail_log_prefix = "service=%{protocol}, user=%{user}, ip=[%{remote_ip }]. "
pop3_logout_format = "rcvd=%{input}, sent=%{output}, top=%{top_count}/%{top_bytes}, retr=%{retr_count}/%{retr_bytes}, del=%{deleted_count}/%{deleted_bytes}, size=%{message_bytes}"
imap_logout_format = "rcvd=%{input}, sent=%{output}"

# Customizable part of configuration gets included below. The filenames are
# first sorted by their ASCII value and parsed in that order. The 00-prefixes
# in filenames are intended to make it easier to understand the ordering.
#
# Prefixes 10 through 20 and 90 through 95 (inclusive) are reserved for Plesk. 
# Please do not occupy them or edit files with these prefixes!
!include conf.d/*.conf

# vim:ts=2 sts=2 sw=2 et:
