#!/bin/bash
#
# Create Kerberos environment for exim4 chroot. This is needed
# to cope with the exim4 security fix for CVE-2016-1531. 

set -e

DIR="/var/lib/exim4/etc"
FILE="krb5.keytab.smtp"

if [ ! -f $DIR/$FILE ]; then
    if [ ! -d $DIR ] ; then
	mkdir $DIR
    fi
fi
cp /etc/$FILE $DIR
chown Debian-exim:Debian-exim $DIR/$FILE
echo "Successfully created the Exim4 environment."
