diff -u dovecot-1.0.5/debian/dovecot-imapd.postinst dovecot-1.0.5/debian/dovecot-imapd.postinst --- dovecot-1.0.5/debian/dovecot-imapd.postinst +++ dovecot-1.0.5/debian/dovecot-imapd.postinst @@ -2,8 +2,11 @@ set -e -#perl -pi.bak -e 'if (/^\s*protocols =/i) { s/$/ imap imaps/ unless /imap/; };'\ -# /etc/dovecot/dovecot.conf +if [ "$1" = "configure" -a -z "$2" ]; then + # Add the imap and imaps options to the protocols line on first install + perl -pi.bak -e 'if (/^\s*protocols =/i) { s/$/ imap imaps/ unless /imap|none/; };'\ + /etc/dovecot/dovecot.conf +fi if [ -x "/etc/init.d/dovecot" ]; then diff -u dovecot-1.0.5/debian/dovecot-pop3d.postinst dovecot-1.0.5/debian/dovecot-pop3d.postinst --- dovecot-1.0.5/debian/dovecot-pop3d.postinst +++ dovecot-1.0.5/debian/dovecot-pop3d.postinst @@ -2,8 +2,12 @@ set -e -#perl -pi.bak -e 'if (/^\s*protocols =/i) { s/$/ pop3 pop3s/ unless /pop3/; };'\ -# /etc/dovecot/dovecot.conf +if [ "$1" = "configure" -a -z "$2" ]; then + # Add the pop3 and pop3s options to the protocols line. + perl -pi.bak -e 'if (/^\s*protocols =/i) { s/$/ pop3 pop3s/ unless /pop3|none/; };'\ + /etc/dovecot/dovecot.conf +fi + if [ -x "/etc/init.d/dovecot" ]; then if [ -x /usr/sbin/invoke-rc.d ]; then invoke-rc.d dovecot start only in patch2: unchanged: --- dovecot-1.0.5.orig/debian/dovecot-imapd.postrm +++ dovecot-1.0.5/debian/dovecot-imapd.postrm @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + + +if [ "$1" = "remove" ]; then + # Remove the imaps and imap option from the protocols line + perl -pi.bak -e 'if (/^\s*protocols =/i) { s/imaps//; s/imap//; };'\ + /etc/dovecot/dovecot.conf +fi + +#DEBHELPER# only in patch2: unchanged: --- dovecot-1.0.5.orig/debian/dovecot-pop3d.postrm +++ dovecot-1.0.5/debian/dovecot-pop3d.postrm @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + + +if [ "$1" = "remove" ]; then + # Remove the imaps and imap option from the protocols line + perl -pi.bak -e 'if (/^\s*protocols =/i) { s/pop3s//; s/pop3//; };'\ + /etc/dovecot/dovecot.conf +fi + +#DEBHELPER#