#!/bin/bash svcstop /service/cyrus-imapd || exit 1 # User en group adden groupadd mail &>/dev/null useradd cyrus &>/dev/null # /etc/services aanpassen als dit nodig is... if [ "`grep 'callbook' /etc/services`" ]; then cat /etc/services | sed -e 's/callbook/sieve\t/' > /tmp/services.tmp mv /tmp/services.tmp /etc/services || exit 1 fi # Spooldir maken if [ ! -d /var/spool/imap ]; then cd /var/spool mkdir imap chown cyrus:mail imap chmod 775 imap || exit 1 fi # imap database aanmaken CONFIGDIR="/home/system/cyrus-imap" if [ ! -d "$CONFIGDIR/proc" ] || [ ! -d "$CONFIGDIR/db" ] || [ ! -d "$CONFIGDIR/socket" ] || [ ! -d "$CONFIGDIR/log" ] || [ ! -d "$CONFIGDIR/msg" ] || [ ! -d "$CONFIGDIR/ptclient" ]; then mkdir -p /home/system/cyrus-imap /usr/bin/mkimap || exit 1 mkdir -p /home/system/cyrus-imap/maildir/user chown -R cyrus:mail /home/system/cyrus-imap fi #dspam checked nu op mailbox en moet hier bij kunnen chmod 771 /home/system/cyrus-imap/maildir || exit 1 # Sievedir maken if [ ! -d /home/system/cyrus-imap/sieve ]; then cd /home/system/cyrus-imap mkdir sieve chown cyrus:mail sieve chmod 750 sieve || exit 1 fi # Private key de goeie permissies geven, zodat imapd hem kan lezen... if [ -f /usr/webint/ssl/server.pem ]; then chmod 660 /usr/webint/ssl/server.pem chown root:users /usr/webint/ssl/server.pem fi #configs updaten #if ! grep allowplaintext /etc/imapd.conf; then # echo "allowplaintext: on" >> /etc/imapd.conf #fi mv /etc/cyrus.conf.new /etc/cyrus.conf &>/dev/null mv /etc/imapd.conf.new /etc/imapd.conf &>/dev/null svcreset /service/cyrus-imapd || exit 1