48 |
48 |
49 Dovecot v1.2.x/v2.0.x/v2.1.x |
49 Dovecot v1.2.x/v2.0.x/v2.1.x |
50 """""""""""""""""""""""""""" |
50 """""""""""""""""""""""""""" |
51 .. code-block:: postgresql-console |
51 .. code-block:: postgresql-console |
52 |
52 |
53 mailsys=> \i /path/to/vmm-0.6.0/pgsql/update_tables_0.5.x-0.6-dovecot-1.2.x.pgsql |
53 mailsys=> \i /path/to/vmm-0.6.1/pgsql/update_tables_0.5.x-0.6-dovecot-1.2.x.pgsql |
54 mailsys=> \q |
54 mailsys=> \q |
55 |
55 |
56 Dovecot v1.0.x/v1.1.x |
56 Dovecot v1.0.x/v1.1.x |
57 """"""""""""""""""""" |
57 """"""""""""""""""""" |
58 .. code-block:: postgresql-console |
58 .. code-block:: postgresql-console |
59 |
59 |
60 mailsys=> \i /path/to/vmm-0.6.0/pgsql/update_tables_0.5.x-0.6.pgsql |
60 mailsys=> \i /path/to/vmm-0.6.1/pgsql/update_tables_0.5.x-0.6.pgsql |
61 mailsys=> \q |
61 mailsys=> \q |
62 |
62 |
63 .. _set-database-permissions: |
63 .. _set-database-permissions: |
64 |
64 |
65 Set database permissions |
65 Set database permissions |
72 .. warning:: All the views (*dovecot_…* and *postfix_…*) have been |
72 .. warning:: All the views (*dovecot_…* and *postfix_…*) have been |
73 replaced by database functions. |
73 replaced by database functions. |
74 So you have to adjust all your ``postfix/pgsql-*.cf`` files and also your |
74 So you have to adjust all your ``postfix/pgsql-*.cf`` files and also your |
75 ``/etc/dovecot/dovecot-sql.conf`` or ``/etc/dovecot/dovecot-sql.conf.ext``. |
75 ``/etc/dovecot/dovecot-sql.conf`` or ``/etc/dovecot/dovecot-sql.conf.ext``. |
76 |
76 |
77 See the `vmm-0.6.0/postfix/pgsql-*.cf` files and |
77 See the `vmm-0.6.1/postfix/pgsql-*.cf` files and |
78 :ref:`Dovecot configuration <dovecot-sql-conf-ext>`/`dovecot-sql.conf.ext` |
78 :ref:`Dovecot configuration <dovecot-sql-conf-ext>`/`dovecot-sql.conf.ext` |
79 or :ref:`Dovecot configuration <dovecot-sql-conf>`/`dovecot-sql-conf`. |
79 or :ref:`Dovecot configuration <dovecot-sql-conf>`/`dovecot-sql-conf`. |
80 |
80 |
81 After a successfully update start Dovecot and Postfix again. |
81 After a successfully update start Dovecot and Postfix again. |
82 |
82 |
92 Finally execute the :file:`upgrade.sh` script. |
92 Finally execute the :file:`upgrade.sh` script. |
93 This will install the new code and also update your :file:`vmm.cfg`. |
93 This will install the new code and also update your :file:`vmm.cfg`. |
94 |
94 |
95 .. code-block:: console |
95 .. code-block:: console |
96 |
96 |
97 root@host:~# cd /path/to/vmm-0.6.0 |
97 root@host:~# cd /path/to/vmm-0.6.1 |
98 root@host:/path/to/vmm-0.6.0# ./upgrade.sh |
98 root@host:/path/to/vmm-0.6.1# ./upgrade.sh |
99 Please have a look at your configuration: /usr/local/etc/vmm.cfg |
99 Please have a look at your configuration: /usr/local/etc/vmm.cfg |
100 This are your Modified/Renamed/New settings: |
100 This are your Modified/Renamed/New settings: |
101 R account.delete_directory = false |
101 R account.delete_directory = false |
102 R account.directory_mode = 448 |
102 R account.directory_mode = 448 |
103 R account.disk_usage = false |
103 R account.disk_usage = false |
119 Removed section "config" with option "done" (obsolte) |
119 Removed section "config" with option "done" (obsolte) |
120 |
120 |
121 Removed option "gid_mail" from section "misc" (obsolte) |
121 Removed option "gid_mail" from section "misc" (obsolte) |
122 |
122 |
123 |
123 |
|
124 Upgrading from vmm-0.6.0 |
|
125 ------------------------ |
|
126 |
|
127 Database fixes |
|
128 ^^^^^^^^^^^^^^ |
|
129 Due to an error in :ref:`usertransport`'s argument parsing, it is possible |
|
130 that some users' transport-ID points to the erroneous transport *domain*. |
|
131 To fix that error in your database, execute the following SQL statement: |
|
132 |
|
133 .. code-block:: psql |
|
134 |
|
135 UPDATE users SET tid = NULL |
|
136 WHERE tid = (SELECT tid FROM transport WHERE transport = 'domain'); |
|
137 |
|
138 If you are using Dovecot < v.1.2.0, you have to replace the database |
|
139 function *dovecotpassword()*. |
|
140 The *service_set.ssid* was selected unconditionally. |
|
141 This may cause an empty result, which will make logins impossible. |
|
142 To replace the function execute the following SQL statement: |
|
143 |
|
144 .. code-block:: psql |
|
145 |
|
146 CREATE OR REPLACE FUNCTION dovecotpassword( |
|
147 IN localpart varchar, IN the_domain varchar) RETURNS SETOF dovecotpassword |
|
148 AS $$ |
|
149 DECLARE |
|
150 record dovecotpassword; |
|
151 userid varchar(320) := localpart || '@' || the_domain; |
|
152 BEGIN |
|
153 FOR record IN |
|
154 SELECT userid, passwd, smtp, pop3, imap, managesieve |
|
155 FROM users, service_set, domain_data |
|
156 WHERE users.gid = (SELECT gid |
|
157 FROM domain_name |
|
158 WHERE domainname = the_domain) |
|
159 AND local_part = localpart |
|
160 AND users.gid = domain_data.gid |
|
161 AND CASE WHEN |
|
162 users.ssid IS NOT NULL |
|
163 THEN |
|
164 service_set.ssid = users.ssid |
|
165 ELSE |
|
166 service_set.ssid = domain_data.ssid |
|
167 END |
|
168 LOOP |
|
169 RETURN NEXT record; |
|
170 END LOOP; |
|
171 RETURN; |
|
172 END; |
|
173 $$ LANGUAGE plpgsql STABLE |
|
174 RETURNS NULL ON NULL INPUT |
|
175 EXTERNAL SECURITY INVOKER; |
|
176 |
|
177 Upgrade vmm |
|
178 ^^^^^^^^^^^ |
|
179 Execute the :file:`upgrade.sh`, in order to install the updated code. |
|
180 |
124 Upgrade to Dovecot ≧ v1.2.beta2 |
181 Upgrade to Dovecot ≧ v1.2.beta2 |
125 ------------------------------- |
182 ------------------------------- |
126 When you are upgrading your old Dovecot (< v.1.2.beta2) to a newer version, |
183 When you are upgrading your old Dovecot (< v.1.2.beta2) to a newer version, |
127 ≧ v1.2.beta2, you also have to update the database layout. |
184 ≧ v1.2.beta2, you also have to update the database layout. |
128 After you have backed up your database, you have to apply the changes from |
185 After you have backed up your database, you have to apply the changes from |