IRedMail/FAQ/Upgrade.Dovecot.1.1.to.1.2
From iRedMail
(→on RHEL/CentOS 5) |
(→Update Dovecot configure) |
||
| (10 intermediate revisions not shown) | |||
| Line 5: | Line 5: | ||
= Install Dovecot 1.2 = | = Install Dovecot 1.2 = | ||
== on RHEL/CentOS 5 == | == on RHEL/CentOS 5 == | ||
| - | Dovecot 1.2 is available in [http://iredmail.org/yum/rpms/ | + | Dovecot 1.2 is available in [http://iredmail.org/yum/rpms/dovecot/ another iRedMail yum repository], you should append below lines in '''/etc/yum.repos.d/iRedMail.repo''' to enable it: |
| + | {{cfg|/etc/yum.repos.d/iRedMail.repo|<pre> | ||
| + | [iRedMail-Dovecot-12] | ||
| + | name=iRedMail-Dovecot-12 | ||
| + | baseurl=http://iredmail.org/yum/rpms/dovecot/rhel5/ | ||
| + | enabled=1 | ||
| + | gpgcheck=0 | ||
| + | priority=1 | ||
| + | </pre>}} | ||
| + | '''NOTE''': Because iRedMail-0.6.1 and earlier versions doesn't support dovecot-1.2, so we can't add this package in default yum repository, otherwise new installation of iRedMail (<=0.6.1) will be failed. | ||
| - | Be | + | Remove dovecot-1.1. Be aware of below steps, we will update dovecot config based on config file of '''dovecot-1.1'''. |
{{cmd|<pre> | {{cmd|<pre> | ||
# cp /etc/dovecot.conf /etc/dovecot-1.1.conf | # cp /etc/dovecot.conf /etc/dovecot-1.1.conf | ||
| Line 13: | Line 22: | ||
warning: /etc/logrotate.d/dovecot saved as /etc/logrotate.d/dovecot.rpmsave | warning: /etc/logrotate.d/dovecot saved as /etc/logrotate.d/dovecot.rpmsave | ||
warning: /etc/dovecot.conf saved as /etc/dovecot.conf.rpmsave | warning: /etc/dovecot.conf saved as /etc/dovecot.conf.rpmsave | ||
| + | </pre>}} | ||
| + | Install dovecot-1.2. | ||
| + | {{cmd|<pre> | ||
# yum install dovecot dovecot-sieve dovecot-managesieve | # yum install dovecot dovecot-sieve dovecot-managesieve | ||
# cp /etc/dovecot.conf /etc/dovecot-1.2.conf | # cp /etc/dovecot.conf /etc/dovecot-1.2.conf | ||
| Line 33: | Line 45: | ||
Install Dovecot 1.2: | Install Dovecot 1.2: | ||
{{cmd|<pre> | {{cmd|<pre> | ||
| - | $ sudo apt-get update | + | $ sudo apt-get -t lenny-backports update |
| - | $ sudo apt-get upgrade dovecot-imapd dovecot-pop3d | + | $ sudo apt-get -t lenny-backports upgrade dovecot-imapd dovecot-pop3d |
</pre>}} | </pre>}} | ||
| Line 40: | Line 52: | ||
We need to update Dovecot config file '''dovecot.conf''', it's '''/etc/dovecot.conf''' on RHEL/CentOS, '''/etc/dovecot/dovecot.conf''' on Debian 5. | We need to update Dovecot config file '''dovecot.conf''', it's '''/etc/dovecot.conf''' on RHEL/CentOS, '''/etc/dovecot/dovecot.conf''' on Debian 5. | ||
| - | * Remove '''umask'''. It wasn't really used anywhere anymore. | + | * Remove setting '''umask ='''. It wasn't really used anywhere anymore. |
| - | * Remove | + | * Remove '''zlib''' from all '''mail_plugins =''' settings.. This plugin is buggy in 1.x and will be fixed only in 2.x. |
* Change sieve plugin name '''cmusieve''' to '''sieve''' in '''protocol lda {}''' section. | * Change sieve plugin name '''cmusieve''' to '''sieve''' in '''protocol lda {}''' section. | ||
* Change '''ssl_disable=no''' to '''ssl=yes'''. | * Change '''ssl_disable=no''' to '''ssl=yes'''. | ||
| Line 76: | Line 88: | ||
protocols = pop3 pop3s imap imaps managesieve | protocols = pop3 pop3s imap imaps managesieve | ||
</pre>}} | </pre>}} | ||
| + | |||
| + | * '''[For Debian 5 (lenny)]''' Move '''sieve =''' and '''sieve_storage =''' from section '''protocol managesieve {}''' to section '''plugin {}''', and rename '''sieve_storage''' to '''sieve_dir''': | ||
| + | {{cfg|dovecot.conf|<pre> | ||
| + | plugin { | ||
| + | sieve = /var/vmail/sieve/%Ld/%Ln/dovecot.sieve | ||
| + | sieve_dir = /var/vmail/sieve/%Ld/%Ln/ | ||
| + | # ... SKIP OTHER SETTINGS HERE ... | ||
| + | } | ||
| + | </pre>}} | ||
| + | |||
| + | = Re-enable RoundCube sieve rules = | ||
| + | This is needed so your users will not loose all their RoundCube sieve rules. | ||
| + | You need to run the following commands to mass rename the RoundCube rules and repair their links: | ||
| + | {{cmd|<pre> | ||
| + | find /var/vmail/sieve/ -type l -name 'dovecot.sieve' -exec rm -f '{}' \; | ||
| + | find /var/vmail/sieve/ -type f -name 'roundcube' -exec rename 'roundcube' 'roundcube.sieve' '{}' \; | ||
| + | find /var/vmail/sieve/ -type f -name 'roundcube.sieve' -execdir ln -s '{}' dovecot.sieve \; | ||
| + | </pre>}} | ||
| + | |||
| + | |||
| + | [[Category: iRedMail/FAQ]] | ||
| + | [[Category: FAQ]] | ||
Current revision as of 15:51, 30 June 2011
Contents |
This tutorial is for only RHEL/CentOS 5.x, Debian 5.
Install Dovecot 1.2
on RHEL/CentOS 5
Dovecot 1.2 is available in another iRedMail yum repository, you should append below lines in /etc/yum.repos.d/iRedMail.repo to enable it:
| File: /etc/yum.repos.d/iRedMail.repo |
[iRedMail-Dovecot-12] name=iRedMail-Dovecot-12 baseurl=http://iredmail.org/yum/rpms/dovecot/rhel5/ enabled=1 gpgcheck=0 priority=1 |
NOTE: Because iRedMail-0.6.1 and earlier versions doesn't support dovecot-1.2, so we can't add this package in default yum repository, otherwise new installation of iRedMail (<=0.6.1) will be failed.
Remove dovecot-1.1. Be aware of below steps, we will update dovecot config based on config file of dovecot-1.1.
| Terminal: |
# cp /etc/dovecot.conf /etc/dovecot-1.1.conf # rpm -e dovecot dovecot-sieve warning: /etc/logrotate.d/dovecot saved as /etc/logrotate.d/dovecot.rpmsave warning: /etc/dovecot.conf saved as /etc/dovecot.conf.rpmsave |
Install dovecot-1.2.
| Terminal: |
# yum install dovecot dovecot-sieve dovecot-managesieve # cp /etc/dovecot.conf /etc/dovecot-1.2.conf # cp /etc/dovecot-1.1.conf /etc/dovecot.conf |
Package dovecot-managesieve provides 'managesieve' service, so we don't need pysieved anymore. Disable it:
| Terminal: |
# chkconfig --level 345 pysieved off # /etc/init.d/pysieved stop |
on Debian 5
Append below line to /etc/apt/sources.list:
| File: /etc/apt/sources.list |
deb http://backports.debian.org/debian-backports lenny-backports main |
Install Dovecot 1.2:
| Terminal: |
$ sudo apt-get -t lenny-backports update $ sudo apt-get -t lenny-backports upgrade dovecot-imapd dovecot-pop3d |
Update Dovecot configure
We need to update Dovecot config file dovecot.conf, it's /etc/dovecot.conf on RHEL/CentOS, /etc/dovecot/dovecot.conf on Debian 5.
- Remove setting umask =. It wasn't really used anywhere anymore.
- Remove zlib from all mail_plugins = settings.. This plugin is buggy in 1.x and will be fixed only in 2.x.
- Change sieve plugin name cmusieve to sieve in protocol lda {} section.
- Change ssl_disable=no to ssl=yes.
- [For MySQL backend] Add two more columns in vmail.mailbox if not present:
| Terminal: |
$ mysql -uroot -p mysql> USE vmail; mysql> ALTER TABLE mailbox ADD COLUMN enablesieve TINYINT(1) NOT NULL DEFAULT '1'; mysql> ALTER TABLE mailbox ADD COLUMN enablesievesecured TINYINT(1) NOT NULL DEFAULT '1'; |
- [For RHEL/CentOS] Append managesieve service related config:
| File: dovecot.conf |
# ManageSieve service. http://wiki.dovecot.org/ManageSieve
protocol managesieve {
listen = 127.0.0.1:2000
}
# Plugin: sieve. ttp://wiki.dovecot.org/LDA/Sieve
plugin {
#sieve_global_path =
#sieve_global_dir =
#sieve_before = /var/vmail/sieve/dovecot.sieve
#sieve_after =
sieve = /var/vmail/sieve/%Ld/%Ln/dovecot.sieve
sieve_dir = /var/vmail/sieve/%Ld/%Ln/
}
|
Append "managesieve" in "protocols = ", like this:
| File: dovecot.conf |
protocols = pop3 pop3s imap imaps managesieve |
- [For Debian 5 (lenny)] Move sieve = and sieve_storage = from section protocol managesieve {} to section plugin {}, and rename sieve_storage to sieve_dir:
| File: dovecot.conf |
plugin {
sieve = /var/vmail/sieve/%Ld/%Ln/dovecot.sieve
sieve_dir = /var/vmail/sieve/%Ld/%Ln/
# ... SKIP OTHER SETTINGS HERE ...
}
|
Re-enable RoundCube sieve rules
This is needed so your users will not loose all their RoundCube sieve rules. You need to run the following commands to mass rename the RoundCube rules and repair their links:
| Terminal: |
find /var/vmail/sieve/ -type l -name 'dovecot.sieve' -exec rm -f '{}' \;
find /var/vmail/sieve/ -type f -name 'roundcube' -exec rename 'roundcube' 'roundcube.sieve' '{}' \;
find /var/vmail/sieve/ -type f -name 'roundcube.sieve' -execdir ln -s '{}' dovecot.sieve \;
|
