if [ ! -f /etc/email/email.sig ]
then
    /usr/bin/mkdir -p /etc/email
    /usr/bin/cp /etc/defaults/etc/email/email.sig /etc/email/email.sig
fi

if [ ! -f /etc/email/email.address.template ]
then
    /usr/bin/mkdir -p /etc/email
    /usr/bin/cp /etc/defaults/etc/email/email.address.template /etc/email/email.address.template
fi

if [ ! -f /etc/email/email.conf ]
then
    /usr/bin/mkdir -p /etc/email
    /usr/bin/cp /etc/defaults/etc/email/email.conf /etc/email/email.conf
fi

if [ ! -f /etc/email/mime.types ]
then
    /usr/bin/mkdir -p /etc/email
    /usr/bin/cp /etc/defaults/etc/email/mime.types /etc/email/mime.types
fi

if [ ! -f /etc/email/email.help ]
then
    /usr/bin/mkdir -p /etc/email
    /usr/bin/cp /etc/defaults/etc/email/email.help /etc/email/email.help
fi

#! /bin/sh
set -e

ADMINSGID="$(getent -w passwd S-1-5-32-544)"
ADMINSGID="${ADMINSGID#*:}"
ADMINSGID="${ADMINSGID%%:*}"

chgrp ${ADMINSGID} /etc/defaults/etc/email/* 2>/dev/null \
&& chmod 664 /etc/defaults/etc/email/* 2>/dev/null

exit 0
