wok-next rev 2354

cyrus-imapd: create spool and sieve hash
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Mar 05 10:37:33 2009 +0000 (2009-03-05)
parents bc316434f97b
children ccbe622281a0
files cyrus-imapd/stuff/etc/init.d/cyrus-imapd
line diff
     1.1 --- a/cyrus-imapd/stuff/etc/init.d/cyrus-imapd	Thu Mar 05 08:35:57 2009 +0000
     1.2 +++ b/cyrus-imapd/stuff/etc/init.d/cyrus-imapd	Thu Mar 05 10:37:33 2009 +0000
     1.3 @@ -24,14 +24,38 @@
     1.4      dir=$(grep ^configdirectory /etc/imapd.conf | awk '{ print $2 }')
     1.5      if [ ! -f $dir/mailboxes.db ]; then
     1.6        echo -n "Initialize $DESC: "
     1.7 -      /usr/cyrus/bin/mkimap
     1.8 +      #/usr/cyrus/bin/mkimap
     1.9 +      for i in db proc socket log msg user quota; do
    1.10 +        [ -d $dir/$i ] || mkdir -p -m 700 $dir/$i
    1.11 +      done
    1.12        for i in user quota ; do
    1.13          for j in a b c d e f g h i j k l m n o p q r s t u v w x y z ; do
    1.14            [ -d $dir/$i/$j ] || mkdir -p $dir/$i/$j
    1.15          done
    1.16        done
    1.17        chown -R cyrus:mail $dir
    1.18 -      chmod 750 $dir
    1.19 +      chmod 750 $dir $dir/socket
    1.20 +      for i in $(grep ^partition /etc/imapd.conf | awk '{ print $2 }') ; do
    1.21 +        [ -d $i ] || mkdir -p -m 750 $i
    1.22 +        case "$(grep ^hashimapspool /etc/imapd.conf | awk '{ print $2 }')" in
    1.23 +        y*|t*|1|on)
    1.24 +          for j in a b c d e f g h i j k l m n o p q r s t u v w x y z ; do
    1.25 +            [ -d $i/$j ] || mkdir -p $i/$j
    1.26 +          done ;;
    1.27 +        esac
    1.28 +        [ -d $i/stage. ] || mkdir $i/stage. 
    1.29 +        chown -R cyrus:mail $i
    1.30 +      done
    1.31 +      case "$(grep ^sieveusehomedir /etc/imapd.conf | awk '{ print $2 }')" in
    1.32 +      y*|t*|1|on)
    1.33 +        sieve=$(grep ^sievedir /etc/sieve | awk '{ print $2 }')
    1.34 +        [ -d $sieve ] || mkdir $sieve
    1.35 +        chmod 755 $sieve
    1.36 +        for j in a b c d e f g h i j k l m n o p q r s t u v w x y z ; do
    1.37 +          [ -d $sieve/$j ] || mkdir -p -m 755 $sieve/$j
    1.38 +        done
    1.39 +        chown -R cyrus:mail $sieve ;;
    1.40 +      esac
    1.41        su cyrus -c "/usr/cyrus/bin/ctl_cyrusdb -r"
    1.42        su cyrus -c "/usr/cyrus/bin/reconstruct"
    1.43        status