Remove deprecated 'autocreate' plugin. Modify expire plugin.

This commit is contained in:
Christoph 2017-11-06 17:48:22 +01:00
parent 186d3b94d5
commit 9176017e53

View File

@ -1251,19 +1251,23 @@ fi
## -
_failed=false
echononl "\tAdjusting file 15-mailboxes.conf"
perl -i.ORIG -n -p -e "s#^([ ]*)(mailbox\ +Drafts\ +{.*)#\1\2\n\1 auto = subscribe#g" \
/usr/local/dovecot-${_version}/etc/dovecot/conf.d/15-mailboxes.conf || _failed=true
if [ "$spam_folder" != "Junk" ]; then
perl -i.ORIG -n -p -e "s#^([ ]*)(mailbox\ +Junk\ +{.*)#\1mailbox $spam_folder {\n\1 auto = subscribe\n\1 special_use = \\\Junk\n\1}\n\1\2#g" \
perl -i -n -p -e "s#^([ ]*)(mailbox\ +Junk\ +{.*)#\1mailbox $spam_folder {\n\1 auto = subscribe\n\1 special_use = \\\Junk\n\1}\n\1\2#g" \
/usr/local/dovecot-${_version}/etc/dovecot/conf.d/15-mailboxes.conf || _failed=true
perl -i -n -p -e "s#^([ ]*)(mailbox\ +Junk\ +{.*)#\1\2\n\1 auto = no#g" \
/usr/local/dovecot-${_version}/etc/dovecot/conf.d/15-mailboxes.conf || _failed=true
else
perl -i.ORIG -n -p -e "s#^([ ]*)(mailbox\ +$spam_folder\ +{.*)#\1\2\n\1 auto = subscribe#g" \
perl -i -n -p -e "s#^([ ]*)(mailbox\ +$spam_folder\ +{.*)#\1\2\n\1 auto = subscribe#g" \
/usr/local/dovecot-${_version}/etc/dovecot/conf.d/15-mailboxes.conf || _failed=true
fi
perl -i -n -p -e "s#^([ ]*)(mailbox\ +Drafts\ +{.*)#\1\2\n\1 auto = subscribe#g" \
/usr/local/dovecot-${_version}/etc/dovecot/conf.d/15-mailboxes.conf || _failed=true
perl -i -n -p -e "s#^([ ]*)(mailbox\ +Trash\ +{.*)#\1\2\n\1 auto = subscribe#g" \
/usr/local/dovecot-${_version}/etc/dovecot/conf.d/15-mailboxes.conf || _failed=true
perl -i -n -p -e "s#^([ ]*)(mailbox\ +Sent\ +{.*)#\1\2\n\1 auto = subscribe#g" \
/usr/local/dovecot-${_version}/etc/dovecot/conf.d/15-mailboxes.conf || _failed=true
perl -i -n -p -e "s#^([ ]*)(mailbox\ +\"Sent Messages\"\ +{.*)#\1\2\n\1 auto = no#g" \
/usr/local/dovecot-${_version}/etc/dovecot/conf.d/15-mailboxes.conf || _failed=true
if ! $_failed ; then
echo -e "$rc_done"
@ -1605,25 +1609,24 @@ fi
## - edit /usr/local/dovecot/etc/dovecot/conf.d/90-plugin.conf
## -
## - autocreate = $spam_folder
## - autocreate2 = Sent
## - autocreate3 = Trash
## - autocreate4 = Drafts
## - autosubscribe = $spam_folder
## - autosubscribe2 = Sent
## - autosubscribe3 = Trash
## - autosubscribe4 = Drafts
## - Note:
## - Setting "autocreate", "autosubscribe" here is depricated. Use mailbox { auto } setting instead.
## -
## - expire_dict = proxy::expire
## - expire = Trash
## - expire2 = Trash/*
## - expire3 = Spam
## -
## - expire = Trash
## - expire2 = Trash.*
## - expire3 = $spam_folder
## - expire_dict = proxy::expire
## -
## - # Enable caching of dict value in dovecot.index file. This significantly reduces
## - # the number of dict lookups. It makes initial testing more confusing though, so
## - # it's better to enable it only after you've verified that the expire plugin is
## - # working as wanted. (v2.2.16+)
## - expire_cache = yes
## -
_failed=false
echononl "\tAdjusting file 90-plugin.conf"
perl -i.ORIG -n -p -e "s#^([ ]*)(\#?\ ?setting_name\ +=.*)#\1\2\n\n\1autocreate = $spam_folder\n\1autocreate2 = Sent\n\1autocreate3 = Trash\n\1autocreate4 = Drafts\n\n\1autosubscribe = $spam_folder\n\1autosubscribe2 = Sent\n\1autosubscribe3 = Trash\n\1autosubscribe4 = Drafts\n\n\1expire_dict = proxy::expire\n\n\1expire = Trash\n\1expire2 = Trash.*\n\1expire3 = $spam_folder\n#g" \
perl -i.ORIG -n -p -e "s#^([ ]*)(\#?\ ?setting_name\ +=.*)#\1\2\n\n\1expire = Trash\n\1expire2 = Trash/*\n\1expire3 = $spam_folder\n\n\1expire_dict = proxy::expire\n\n\1\# Enable caching of dict value in dovecot.index file. This significantly reduces\n\1\# the number of dict lookups. It makes initial testing more confusing though, so\n\1\# it's better to enable it only after you've verified that the expire plugin is\n\1\# working as wanted. (v2.2.16+)\n\1expire_cache = yes#g" \
/usr/local/dovecot-${_version}/etc/dovecot/conf.d/90-plugin.conf || _failed=true
if ! $_failed ; then