##
## Settings for the Sieve interpreter
##

plugin {

  sieve_plugins = sieve_imapsieve sieve_extprograms

  sieve = /home/vmail/%d/%n/.dovecot.sieve
  sieve_default = /etc/dovecot/sieve/default.sieve
  sieve_after = /home/vmail/sieve/default.sieve
  sieve_dir = /home/vmail/%d/%n/sieve
  sieve_global = /home/vmail/sieve
  sieve_max_script_size = 1M
  sieve_quota_max_scripts = 0
  sieve_quota_max_storage = 0
  sieve_pipe_bin_dir = /etc/dovecot/sieve
  sieve_global_extensions = +vnd.dovecot.pipe

  # Pigeonhole Sieve Vacation Extension fix
  # --------------------------------------------------------------
  # More info :
  # https://github.com/hardware/mailserver/issues/227
  # http://wiki2.dovecot.org/Pigeonhole/Sieve/Extensions/Vacation
  # https://tools.ietf.org/html/rfc5230#section-4.5

  # Set the enveloppe address to allow rspamd to guess which
  # domain key the message should be signed with
  sieve_vacation_send_from_recipient = yes

  # Send vacation replies even for aliases
  sieve_vacation_dont_check_recipient = yes
  # --------------------------------------------------------------

  # From elsewhere to Spam folder
  imapsieve_mailbox1_name = Spam
  imapsieve_mailbox1_causes = COPY
  imapsieve_mailbox1_before = file:/etc/dovecot/sieve/report-spam.sieve

  # From Spam folder to elsewhere
  imapsieve_mailbox2_name = *
  imapsieve_mailbox2_from = Spam
  imapsieve_mailbox2_causes = COPY
  imapsieve_mailbox2_before = file:/etc/dovecot/sieve/report-ham.sieve

}
