# 2.0.7: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.36-gentoo x86_64 Gentoo Base System release 2.0.1 

auth_cache_negative_ttl = 10 mins
auth_debug = no
auth_debug_passwords = no
mail_debug = no
auth_mechanisms = plain login
auth_socket_path = /var/spool/dovecot/auth-userdb
base_dir = /var/spool/dovecot/
default_vsz_limit = 1024 M
disable_plaintext_auth = no
dotlock_use_excl = yes
lda_mailbox_autocreate = yes
lda_mailbox_autosubscribe = yes
listen = *
mmap_disable = yes
mail_fsync = always
mail_nfs_storage = no
mail_nfs_index = no
mail_location = maildir:~/Maildir
mail_plugins = $mail_plugins quota notify expire
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
ssl_cert = </etc/dovecot/ssl/mail.crt
ssl_key = </etc/dovecot/ssl/mail.key
ssl_verify_client_cert = no
ssl_dh = </etc/dovecot/dh.pem
verbose_ssl = no
shutdown_clients = no

protocols = imap pop3 sieve lmtp

userdb {
  args = /etc/dovecot/dovecot-ldap.conf
  driver = ldap
}

passdb {
  args = /etc/dovecot/dovecot-ldap-pass.conf
  driver = ldap
}

service auth {
  client_limit = 5000
  unix_listener auth-userdb {
    mode = 0666
  }
}

service imap-login {
  process_min_avail = 6
  service_count = 0
}

service pop3-login {
  process_min_avail = 6
  service_count = 0
}

service managesieve-login {
  process_min_avail = 6
  service_count = 0
  inet_listener sieve {
    address = 127.0.0.1, 192.168.0.1
    port = 4190
  }
}

service managesieve {
}

service dict {
  unix_listener dict {
    group = vmail
    mode = 0666
  }
} 

service quota-warning {
  executable = script /etc/dovecot/quota-warning.sh
  unix_listener quota-warning {
    group = vmail
    mode = 0666
  }
}
 
service lmtp {
  executable = lmtp -L
  process_min_avail = 6
  service_count = 0
  unix_listener lmtp {
    group = vmail
    mode = 0666
  }
}

service stats {
  unix_listener stats-reader {
    group = vmail
    mode = 0666
  }
  unix_listener stats-writer {
    group = vmail
    mode = 0666
  }
}

service anvil {
  unix_listener anvil {
    group = vmail
    mode = 0666
  }
}

protocol imap {
  imap_client_workarounds = delay-newmail
  mail_plugins = quota imap_quota mail_log notify
}

protocol pop {
  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
  pop3_uidl_format = %g
  pop3_fast_size_lookups = yes
  mail_plugins = 
}

protocol lmtp {
  hostname = domain.com
  postmaster_address = postmaster@domain.com
  mail_fsync = optimized
  mail_plugins = quota notify expire sieve
  log_path = 
  info_log_path = /var/log/dovecot-lmtp.log
  #submission_host = 192.168.0.1
}

plugin {
  quota = maildir:User quota
  quota_rule = *:storage=1M 
  quota_rule2 = Trash:ignore
  quota_rule3 = Deleted Items:ignore
  quota_rule4 = Junk E-mail:ignore
  quota_rule5 = Archive:ignore
  quota_rule6 = archive:ignore
  quota_warning = storage=90%% quota-warning 90 %u
  quota_grace = 10%%
  sieve = file:~/Maildir/sieve;active=~/Maildir/.dovecot.sieve
  sieve_vacation_use_original_recipient = yes
  sieve_user_email = postmaster@domain.com
  expire_dict = proxy::expire
  expire = Trash
  expire2 = Deleted Items
  expire3 = Junk E-mail 
  expire_cache = yes
  lmtp_rcpt_check_quota = yes
}
