#!/bin/sh

#
# This is an example script which creates a .forward file
# in the home directory of a user, which is being created
# in Kopano. Place this file, with executable rights, in
# /etc/kopano/userscripts/createuser.d/
# if you want a .forward file for delivery for each user.
#

HOMEDIR=`getent passwd $KOPANO_USER | cut -d: -f6`

echo "\"| /usr/sbin/kopano-dagent $KOPANO_USER\"" > $HOMEDIR/.forward
chown $KOPANO_USER.$KOPANO_USER $HOMEDIR/.forward
