# This router handles forwards for vhost users
vhost_forward:
  debug_print = "R: vhost_forward for $local_part@$domain"
  driver = redirect
  domains = +vhost_domains
  local_part_suffix = +*
  local_part_suffix_optional
  # Make sure the files exists to avoid awkward failures
  condition  = ${if exists{VHOST_DIR/$domain/VHOST_MAILBOX_DIR/$local_part/forward}}
  file  = VHOST_DIR/$domain/VHOST_MAILBOX_DIR/$local_part/forward
  # Set permissions for any actions we might take
  user  = ${extract{uid}{${stat:VHOST_DIR/$domain}}}
  group = ${extract{gid}{${stat:VHOST_DIR/$domain}}}
  # Set the home directory for any routers/transports.
  router_home_directory    = VHOST_DIR/$domain/VHOST_MAILBOX_DIR/$local_part
  transport_home_directory = VHOST_DIR/$domain/VHOST_MAILBOX_DIR/$local_part
  directory_transport = address_directory
  file_transport = address_file
  pipe_transport = address_pipe
  reply_transport = address_reply
  # these two are required to allow :fail:, :defer: to work
  allow_fail
  allow_defer
  allow_filter
  # Syntax errors do not prevent delivery.
  skip_syntax_errors
  # This stops this router from trying to change uid/gid whilst verifying the
  # address by skipping this router.  The address will get validated by the
  # next router.
  no_verify

