#!/bin/bash

CHRBIN=/usr/sbin/chroot
CHRDIR=/chroot/maild

# fix owner of binaries
chown root:postdrop $CHRDIR/usr/sbin/postdrop
chown root:postdrop $CHRDIR/usr/sbin/postqueue

# set missing suid bit
chmod g+s $CHRDIR/usr/sbin/postdrop
chmod g+s $CHRDIR/usr/sbin/postqueue

# add opendkim to postfix group
usermod -a -G opendkim postfix
$CHRBIN $CHRDIR usermod -a -G opendkim postfix

# add clamav to amavis group
usermod -a -G amavis clamav
$CHRBIN $CHRDIR usermod -a -G amavis clamav
