3 [ "$1" = "configure" ] || exit 0
4 [ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx
7 . /usr/share/carnet-tools/functions.sh
9 cp_check_and_sed '^protocols' \
10 's/protocols.*$/protocols = imap imaps pop3 pop3s/g' \
11 /etc/dovecot/dovecot.conf || true
13 cp_check_and_sed '#disable_plaintext_auth' \
14 's/#disable_plaintext_auth/disable_plaintext_auth/g' \
15 /etc/dovecot/dovecot.conf || true
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
21 cp_check_and_sed '#imap_client_workarounds' \
22 's/#imap_client_workarounds/imap_client_workarounds/g' \
23 /etc/dovecot/dovecot.conf || true
25 cp_check_and_sed '#pop3_client_workarounds' \
26 's/#pop3_client_workarounds/pop3_client_workarounds/g' \
27 /etc/dovecot/dovecot.conf || true
29 cp_check_and_sed 'imap_client_workarounds' \
30 's/imap_client_workarounds.*$/imap_client_workarounds = outlook-idle tb-extra-mailbox-sep netscape-eoh delay-newmail/g' \
31 /etc/dovecot/dovecot.conf || true
33 cp_check_and_sed 'pop3_client_workarounds' \
34 's/pop3_client_workarounds.*$/pop3_client_workarounds = outlook-no-nuls oe-ns-eoh/g' \
35 /etc/dovecot/dovecot.conf || true
37 cp_check_and_sed 'pop3_uidl_format' \
38 's/pop3_uidl_format.*$/pop3_uidl_format = %v.%u/g' \
39 /etc/dovecot/dovecot.conf || true
41 cp_check_and_sed '#quota = maildir' \
42 's/#quota = maildir/quota = fs/g' \
43 /etc/dovecot/dovecot.conf || true
45 # dodano zbog backward compatibility (etch->lenny)
46 cp_check_and_sed '^mail_extra_groups' \
47 's/^mail_extra_groups/mail_privileged_group/g' \
48 /etc/dovecot/dovecot.conf || true
50 cp_check_and_sed '#ssl_cipher_list' \
51 's/#ssl_cipher_list.*/ssl_cipher_list = ALL:!aNULL:!eNULL:!ADH!LOW:!MEDIUM:!EXP:!SSLv2:HIGH/g' \
52 /etc/dovecot/dovecot.conf || true
54 # ovo je potrebno postaviti u verziji 1.2
55 cp_check_and_sed '#mail_location' \
56 's|#mail_location.*|mail_location=mbox:~/mail:INBOX=/var/mail/%u|g' \
57 /etc/dovecot/dovecot.conf || true
60 cp_check_and_sed '#ssl =' \
62 /etc/dovecot/dovecot.conf || true
64 if grep -q "^ssl_disable .*no" /etc/dovecot/dovecot.conf; then
65 cp_check_and_sed '^ssl =' \
66 's/^ssl =.*/ssl = yes/g' \
67 /etc/dovecot/dovecot.conf || true
68 elif grep -q "^ssl_disable .*yes" /etc/dovecot/dovecot.conf; then
69 cp_check_and_sed '^ssl =' \
70 's/^ssl =.*/ssl = no/g' \
71 /etc/dovecot/dovecot.conf || true
74 cp_check_and_sed '^ssl_disable' \
75 's/^ssl_disable/#ssl_disable/g' \
76 /etc/dovecot/dovecot.conf || true
80 if [ -x /usr/sbin/invoke-rc.d ]; then
81 [ -x /etc/init.d/dovecot ] && invoke-rc.d dovecot restart
83 [ -x /etc/init.d/dovecot ] && /etc/init.d/dovecot restart