# 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.35.8-ikhpv1 x86_64 Debian 7.6 ext3
mail_debug = yes
auth_mechanisms = plain login
auth_verbose = yes
first_valid_gid = 7788
first_valid_uid = 7788
last_valid_gid = 7788
last_valid_uid = 7788
log_timestamp = "%Y-%m-%d %H:%M:%S "
mail_location = maildir:/var/email/%d/%n/Maildir:LAYOUT=fs
mail_privileged_group = email
passdb {
  args = /etc/dovecot/dovecot-pgsql.conf
  driver = sql
}
protocols = imap pop3 sieve lmtp
service auth {
  executable = /usr/lib/dovecot/auth
  inet_listener {
    port = DOVECOT_SASL_PORT
    address = 0.0.0.0
  }
  unix_listener auth-master {
    group = email
    mode = 0600
    user = email
  }
}
ssl_ca = </etc/ssl/private/mail-chain.crt
ssl_cert = </etc/ssl/private/mail.crt
ssl_key = </etc/ssl/private/mail.key
userdb {
  args = /etc/dovecot/dovecot-pgsql.conf
  driver = sql
}
protocol lda {
  auth_socket_path = /var/run/dovecot/auth-master
  mail_plugins = sieve
  postmaster_address = postmaster@example.org
}

plugin {
  # The path to the user's main active script. If ManageSieve is used, this the
  # location of the symbolic link controlled by ManageSieve.
  sieve = ~/.dovecot.sieve
  sieve_before = ~/sieve/01_vacation.sieve
  sieve_extensions = +vacation +vacation-seconds

  # The default Sieve script when the user has none. This is a path to a global
  # sieve script file, which gets executed ONLY if user's private Sieve script
  # doesn't exist. Be sure to pre-compile this script manually using the sievec
  # command line tool.
  # --> See sieve_before fore executing scripts before the user's personal
  #     script.
  #sieve_default = /var/lib/dovecot/sieve/default.sieve

  # Directory for :personal include scripts for the include extension. This
  # is also where the ManageSieve service stores the user's scripts.
  sieve_dir = ~/sieve

  # Directory for :global include scripts for the include extension. 
  sieve_global_dir = /etc/dovecot/sieve/global/
  sieve_global_path = /etc/dovecot/sieve/default.sieve
}

service managesieve-login {
  inet_listener sieve {
    address = 0.0.0.0
  }
}

log_path = /dev/stderr

postmaster_address = postmaster@example.org

service lmtp {
  # Create inet listener only if you can't use the above UNIX socket
  inet_listener lmtp {
    # Avoid making LMTP visible for the entire internet
    address = 0.0.0.0
    port = DOVECOT_LMTP_PORT
  }
}
