3 [ "$1" = "configure" ] || exit 0
4 [ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx
7 . /usr/share/carnet-tools/functions.sh
10 cp_check_and_sed '^protocols' \
11 's/protocols.*$/protocols = imap imaps pop3 pop3s/g' \
12 /etc/dovecot/dovecot.conf || true
14 cp_check_and_sed '#disable_plaintext_auth' \
15 's/#disable_plaintext_auth/disable_plaintext_auth/g' \
16 /etc/dovecot/dovecot.conf || true
18 cp_check_and_sed 'disable_plaintext_auth.*yes' \
19 's/disable_plaintext_auth.*$/disable_plaintext_auth = no/g' \
20 /etc/dovecot/dovecot.conf || true
22 cp_check_and_sed '#imap_client_workarounds' \
23 's/#imap_client_workarounds/imap_client_workarounds/g' \
24 /etc/dovecot/dovecot.conf || true
26 cp_check_and_sed '#pop3_client_workarounds' \
27 's/#pop3_client_workarounds/pop3_client_workarounds/g' \
28 /etc/dovecot/dovecot.conf || true
30 cp_check_and_sed 'imap_client_workarounds' \
31 's/imap_client_workarounds.*$/imap_client_workarounds = outlook-idle tb-extra-mailbox-sep netscape-eoh delay-newmail/g' \
32 /etc/dovecot/dovecot.conf || true
34 cp_check_and_sed 'pop3_client_workarounds' \
35 's/pop3_client_workarounds.*$/pop3_client_workarounds = outlook-no-nuls oe-ns-eoh/g' \
36 /etc/dovecot/dovecot.conf || true
38 cp_check_and_sed 'pop3_uidl_format' \
39 's/pop3_uidl_format.*$/pop3_uidl_format = %v.%u/g' \
40 /etc/dovecot/dovecot.conf || true
42 cp_check_and_sed '#quota = maildir' \
43 's/#quota = maildir/quota = fs/g' \
44 /etc/dovecot/dovecot.conf || true
46 # dodano zbog backward compatibility (etch->lenny)
47 cp_check_and_sed '^mail_extra_groups' \
48 's/^mail_extra_groups/mail_privileged_group/g' \
49 /etc/dovecot/dovecot.conf || true
51 cp_check_and_sed '#ssl_cipher_list' \
52 's/#ssl_cipher_list.*/ssl_cipher_list = ALL:!aNULL:!eNULL:!ADH!LOW:!MEDIUM:!EXP:!SSLv2:HIGH/g' \
53 /etc/dovecot/dovecot.conf || true
55 # ovo je potrebno postaviti u verziji 1.2
56 cp_check_and_sed '#mail_location' \
57 's|#mail_location.*|mail_location=mbox:~/mail:INBOX=/var/mail/%u|g' \
58 /etc/dovecot/dovecot.conf || true
61 cp_check_and_sed '#ssl =' \
63 /etc/dovecot/dovecot.conf || true
65 if grep -q "^ssl_disable .*no" /etc/dovecot/dovecot.conf; then
66 cp_check_and_sed '^ssl =' \
67 's/^ssl =.*/ssl = yes/g' \
68 /etc/dovecot/dovecot.conf || true
69 elif grep -q "^ssl_disable .*yes" /etc/dovecot/dovecot.conf; then
70 cp_check_and_sed '^ssl =' \
71 's/^ssl =.*/ssl = no/g' \
72 /etc/dovecot/dovecot.conf || true
75 cp_check_and_sed '^ssl_disable' \
76 's/^ssl_disable/#ssl_disable/g' \
77 /etc/dovecot/dovecot.conf || true
81 if [ -x /usr/sbin/invoke-rc.d ]; then
82 [ -x /etc/init.d/dovecot ] && invoke-rc.d dovecot restart
84 [ -x /etc/init.d/dovecot ] && /etc/init.d/dovecot restart