Sophie

Sophie

distrib > Fedora > 14 > i386 > media > updates > by-pkgid > a5a6081feab65e1d022f5ed2638340be > scriptlet

cyrus-imapd-2.3.18-1.fc14.i686.rpm

PREIN

/bin/sh
# Create 'cyrus' user on target host
/usr/sbin/groupadd -g 76 -r saslauth 2> /dev/null || :
/usr/sbin/useradd -c "Cyrus IMAP Server" -d /var/lib/imap -g mail \
  -G saslauth -s /sbin/nologin -u 76 -r cyrus 2> /dev/null || :

PREUN

/bin/sh
if [ $1 = 0 ]; then
  /sbin/service cyrus-imapd stop >/dev/null 2>&1 || :
  /sbin/chkconfig --del cyrus-imapd
fi

POSTIN

/bin/sh
/sbin/chkconfig --add cyrus-imapd

# Force synchronous updates, usually only on ext2 filesystems
for i in /var/lib/imap/{user,quota} /var/spool/imap
do
  if [ "$(find $i -maxdepth 0 -printf %F)" = "ext2" ]; then
    chattr -R +S $i 2>/dev/null ||:
  fi
done

# Create SSL certificates
exec > /dev/null 2> /dev/null

if [ ! -f /etc/pki/cyrus-imapd/cyrus-imapd.pem ]; then
pushd /etc/pki/tls/certs
umask 077
cat << EOF | make cyrus-imapd.pem
--
SomeState
SomeCity
SomeOrganization
SomeOrganizationalUnit
localhost.localdomain
root@localhost.localdomain
EOF
chown root.mail cyrus-imapd.pem
chmod 640 cyrus-imapd.pem
mv cyrus-imapd.pem /etc/pki/cyrus-imapd/cyrus-imapd.pem
popd
fi

POSTUN

/bin/sh
if [ $1 != 0 ]; then
  /sbin/service cyrus-imapd condrestart >/dev/null 2>&1 || :
fi