cyrus-imapd/cyrus-imapd.rpm_set_permissions
John Dennis 38f2261a6f auto-import cyrus-imapd-2.2.12-1.2.fc4 on branch devel from
cyrus-imapd-2.2.12-1.2.fc4.src.rpm
2005-04-15 20:24:15 +00:00

31 lines
1.1 KiB
Bash

#!/bin/sh
IMAPCONF=/etc/imapd.conf
CONFDIR=$(grep -se "^configdirectory:" $IMAPCONF | cut -d":" -f2)
if [ "x$CONFDIR" = "x" ]; then
echo "$0 error: configdirectory not found in /etc/imapd.conf, exiting!"
exit 1
fi
find $CONFDIR -type d ! -name "lost+found" -exec chmod 700 {} \; -exec chown cyrus:mail {} \;
grep -se "^partition-.*:" $IMAPCONF | cut -d":" -f2 | while read SPOOLDIR; do
if [ "x$SPOOLDIR" = "x" ]; then
echo "$0 warning: invalid partition configuration in /etc/imapd.conf found!"
else
find $SPOOLDIR -type d ! -name "lost+found" -exec chmod 700 {} \; -exec chown cyrus:mail {} \;
fi
done
find $CONFDIR -type f ! -name "lost+found" -exec chmod 600 {} \; -exec chown cyrus:mail {} \;
grep -se "^partition-.*:" $IMAPCONF | cut -d":" -f2 | while read SPOOLDIR; do
if [ "x$SPOOLDIR" = "x" ]; then
echo "$0 warning: invalid partition configuration in /etc/imapd.conf found!"
else
find $SPOOLDIR -type f ! -name "lost+found" -exec chmod 600 {} \; -exec chown cyrus:mail {} \;
fi
done
# lmtp socket must be accessible by group mail
chmod 750 $CONFDIR
chmod 750 ${CONFDIR}/socket