Ajout : roundcube.
[lhc/ateliers.git] / etc / sv / dovecot / local.sh
1 "$tool"/local/apt-get-install dovecot-imapd dovecot-lmtpd dovecot-managesieved dovecot-pop3d dovecot-sieve
2 "$tool"/local/insserv-remove dovecot
3
4 hint="run before: remote/runit-configure $sv"
5 for domain in \
6 "$local_domainname" \
7 cyclocoop.org
8 do
9 assert "sudo test -f /etc/dovecot/$domain/imap/x509/key.pem" hint
10 sudo install -m 400 -o root -g root \
11 "$tool"/var/pub/x509/imap."$domain"/crt+crl.self-signed.pem \
12 /etc/dovecot/"$domain"/imap/x509/crt+crl.self-signed.pem
13 done
14
15 hint="run before: local/runit-configure nginx -- autoconfig"
16 assert "getent passwd www-autoconfig" hint
17 sudo install -d -m 750 -o www-autoconfig -g www-autoconfig \
18 ~www-autoconfig/mail/
19 sudo install -m 640 -o www-autoconfig -g www-autoconfig \
20 "$tool"/etc/dovecot/autoconfig.xml \
21 ~www-autoconfig/mail/config-v1.1.xml
22
23 sudo usermod --home /home/mail mail
24 sudo install -d -m 0751 -o mail -g mail \
25 ~mail
26 for dir in \
27 /etc/dovecot/acl/global.d \
28 ~mail/data \
29 ~mail/log \
30 /etc/dovecot/sieve \
31 /etc/dovecot/sieve/after.d \
32 /etc/dovecot/sieve/before.d \
33 /etc/dovecot/sieve/global.d
34 do
35 sudo install -d -m 3775 -o root -g root "$dir"
36 done
37 for dir in \
38 after.d \
39 before.d \
40 global.d
41 do
42 if sudo test -e "$tool"/etc/dovecot/sieve/"$dir"
43 then
44 sudo find "$tool"/etc/dovecot/sieve/"$dir" \
45 -maxdepth 1 -type f \
46 -name '*.sieve' \
47 -exec install -m 644 -o root -g root \
48 -t /etc/dovecot/sieve/"$dir" {} +
49 fi
50 sudo sievec /etc/dovecot/sieve/"$dir"
51 sudo find /etc/dovecot/sieve/"$dir" \
52 -maxdepth 1 -type f \
53 -exec chmod 664 {} +
54 done
55
56 #sudo install -d -m 770 -o root -g root \
57 # /etc/skel/etc/mail \
58 # /etc/skel/etc/sieve
59 sudo install -d -m 1777 -o root -g root \
60 /var/lib/dovecot-control \
61 /var/lib/dovecot-index
62 m4 \
63 --define=LOCAL_DOMAINNAME=$local_domainname \
64 <"$tool"/etc/dovecot/dovecot.conf.m4 |
65 sudo install -m 644 -o root -g root /dev/stdin \
66 /etc/dovecot/dovecot.conf
67 sudo install -m 640 -o root -g postfix \
68 "$tool"/etc/dovecot/transport \
69 /etc/dovecot/transport
70 sudo postmap hash:/etc/dovecot/transport