0d7655889c0577efe842a50295b48ebb268c25ac
[dovecot-cn.git] / debian / postinst
1 #!/bin/sh -e
2
3 [ "$1" = "configure" ] || exit 0
4
5 # Load CARNet Tools
6 . /usr/share/carnet-tools/functions.sh
7
8
9 cp_check_and_sed '^protocols' \
10                  's/protocols.*$/protocols = imap imaps pop3 pop3s/g' \
11                  /etc/dovecot/dovecot.conf || true
12
13 cp_check_and_sed '#disable_plaintext_auth' \
14                  's/#disable_plaintext_auth/disable_plaintext_auth/g' \
15                  /etc/dovecot/dovecot.conf || true
16
17 cp_check_and_sed 'disable_plaintext_auth.*yes' \
18                  's/disable_plaintext_auth.*$/disable_plaintext_auth = no/g' \
19                  /etc/dovecot/dovecot.conf || true
20
21 cp_check_and_sed '#client_workarounds' \
22                  's/#client_workarounds/client_workarounds/g' \
23                  /etc/dovecot/dovecot.conf || true
24
25 cp_check_and_sed 'client_workarounds' \
26                  's/client_workarounds.*$/client_workarounds = outlook-idle/g' \
27                  /etc/dovecot/dovecot.conf || true
28
29
30 # restart 
31 if [ -x /usr/sbin/invoke-rc.d ]; then
32   [ -x /etc/init.d/dovecot ] && invoke-rc.d dovecot restart
33 else
34   [ -x /etc/init.d/dovecot ] && /etc/init.d/dovecot restart
35 fi